/*
               File: Ingrediente
        Description: Ingrediente
             Author: GeneXus C# Generator version 10_2_4-75733
       Generated on: 7/17/2014 22:15:23.74
       Program type: Callable routine
          Main DBMS: sqlserver
*/
using System;
using System.Collections;
using GeneXus.Utils;
using GeneXus.Resources;
using GeneXus.Application;
using GeneXus.Metadata;
using System.Data;
using System.Data.SqlClient;
using GeneXus.Data;
using com.genexus;
using GeneXus.Data.ADO;
using GeneXus.Data.NTier;
using GeneXus.Data.NTier.ADO;
using System.Runtime.Remoting;
using GeneXus.WebControls;
using GeneXus.Http;
using GeneXus.XML;
using GeneXus.Search;
using GeneXus.Encryption;
using GeneXus.Http.Client;
using System.Xml.Serialization;
using System.Data.SqlTypes;
using System.ServiceModel;
using System.Runtime.Serialization;
namespace GeneXus.Programs {
   public class ingrediente : GXDataArea, System.Web.SessionState.IRequiresSessionState
   {
      protected void INITENV( )
      {
         if ( GxWebError != 0 )
         {
            return  ;
         }
      }

      protected void INITTRN( )
      {
         initialize_properties( ) ;
         entryPointCalled = false;
         gxfirstwebparm = GetNextPar( );
         gxfirstwebparm_bkp = gxfirstwebparm;
         gxfirstwebparm = DecryptAjaxCall( gxfirstwebparm);
         if ( StringUtil.StrCmp(gxfirstwebparm, "dyncall") == 0 )
         {
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            dyncall( GetNextPar( )) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxExecAct_"+"gxLoad_4") == 0 )
         {
            A32ProveedorId = (long)(NumberUtil.Val( GetNextPar( ), "."));
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxLoad_4( A32ProveedorId) ;
            return  ;
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxEvt") == 0 )
         {
            setAjaxEventMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = GetNextPar( );
         }
         else if ( StringUtil.StrCmp(gxfirstwebparm, "gxajaxNewRow_"+"Gridingrediente_precio") == 0 )
         {
            nRC_Gridingrediente_precio = (short)(NumberUtil.Val( GetNextPar( ), "."));
            nGXsfl_76_idx = (short)(NumberUtil.Val( GetNextPar( ), "."));
            sGXsfl_76_idx = GetNextPar( );
            setAjaxCallMode();
            if ( ! IsValidAjaxCall( true) )
            {
               GxWebError = 1;
               return  ;
            }
            gxnrGridingrediente_precio_newrow( nRC_Gridingrediente_precio, nGXsfl_76_idx, sGXsfl_76_idx) ;
            return  ;
         }
         else
         {
            if ( ! IsValidAjaxCall( false) )
            {
               GxWebError = 1;
               return  ;
            }
            gxfirstwebparm = gxfirstwebparm_bkp;
         }
         if ( String.IsNullOrEmpty(StringUtil.RTrim( context.GetCookie( "GX_SESSION_ID"))) )
         {
            gxcookieaux = context.SetCookie( "GX_SESSION_ID", Crypto.Encrypt64( Crypto.GetEncryptionKey( ), Crypto.GetServerKey( )), "", (DateTime)(DateTime.MinValue), "", 0);
         }
         GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
         Form.Meta.addItem("generator", "GeneXus C# 10_2_4-75733", 0) ;
         Form.Meta.addItem("description", "Ingrediente", 0) ;
         context.wjLoc = "";
         context.nUserReturn = 0;
         context.wbHandled = 0;
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
         }
         GX_FocusControl = edtIngredienteId_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         wbErr = false;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public ingrediente( )
      {
         context = new GxContext(  );
         DataStoreUtil.LoadDataStores( context);
         dsDefault = context.GetDataStore("Default");
         IsMain = true;
         context.SetDefaultTheme("GeneXusXEv2");
      }

      public ingrediente( IGxContext context )
      {
         this.context = context;
         IsMain = false;
         dsDefault = context.GetDataStore("Default");
      }

      public void release( )
      {
      }

      public void execute( )
      {
         executePrivate();
      }

      void executePrivate( )
      {
         isStatic = false;
         webExecute();
      }

      protected override void createObjects( )
      {
      }

      public override void webExecute( )
      {
         if ( initialized == 0 )
         {
            createObjects();
            initialize();
         }
         INITENV( ) ;
         INITTRN( ) ;
         if ( ( GxWebError == 0 ) && ! isAjaxCallMode( ) )
         {
            MasterPageObj = (GXMasterPage) ClassLoader.GetInstance("appmasterpage", "GeneXus.Programs.appmasterpage", new Object[] {new GxContext( context.handle, context.DataStores, context.HttpContext)});
            MasterPageObj.setDataArea(this,false);
            MasterPageObj.webExecute();
            if ( ( GxWebError == 0 ) && context.isAjaxRequest( ) )
            {
               enableOutput();
               if ( ! context.isAjaxRequest( ) )
               {
                  context.GX_webresponse.AppendHeader("Cache-Control", "max-age=0");
               }
               if ( String.IsNullOrEmpty(StringUtil.RTrim( context.wjLoc)) )
               {
                  context.GX_webresponse.AddString((String)(context.getJSONResponse( )));
               }
               else
               {
                  if ( context.isAjaxRequest( ) )
                  {
                     disableOutput();
                  }
                  RenderHtmlHeaders( ) ;
                  context.Redirect( context.wjLoc );
                  context.DispatchAjaxCommands();
               }
            }
         }
         this.cleanup();
      }

      protected void Draw( )
      {
         if ( context.isAjaxRequest( ) )
         {
            disableOutput();
         }
         if ( ! GxWebStd.gx_redirect( context) )
         {
            disable_std_buttons( ) ;
            enableDisable( ) ;
            set_caption( ) ;
            /* Form start */
            wb_table1_2_046( true) ;
         }
         return  ;
      }

      protected void wb_table1_2_046e( bool wbgen )
      {
         if ( wbgen )
         {
         }
         /* Execute Exit event if defined. */
      }

      protected void wb_table1_2_046( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTablemain_Internalname, tblTablemain_Internalname, "", "TableBorder100x100", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table2_5_046( true) ;
         }
         return  ;
      }

      protected void wb_table2_5_046e( bool wbgen )
      {
         if ( wbgen )
         {
            /* Control Group */
            ClassString = "Group";
            StyleString = "";
            context.WriteHtmlText( "<fieldset id=\""+grpGroupdata_Internalname+"\""+" style=\"-moz-border-radius:3pt;\""+" class=\""+ClassString+"\">") ;
            context.WriteHtmlText( "<legend class=\""+ClassString+"Title"+"\">"+"Ingrediente"+"</legend>") ;
            wb_table3_28_046( true) ;
         }
         return  ;
      }

      protected void wb_table3_28_046e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</fieldset>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table1_2_046e( true) ;
         }
         else
         {
            wb_table1_2_046e( false) ;
         }
      }

      protected void wb_table3_28_046( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable1_Internalname, tblTable1_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            ClassString = "ErrorViewer";
            StyleString = "";
            GxWebStd.gx_msg_list( context, "", context.GX_msglist.DisplayMode, StyleString, ClassString, "", "false");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            wb_table4_34_046( true) ;
         }
         return  ;
      }

      protected void wb_table4_34_046e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 83,'',false,'',0)\"";
            ClassString = "BtnEnter";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_enter_Internalname, "", "Confirmar", bttBtn_enter_Jsonclick, 5, "Confirmar", "", StyleString, ClassString, bttBtn_enter_Visible, 1, "standard", "EENTER.", TempTags, "", context.GetButtonType( ), "HLP_Ingrediente.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 84,'',false,'',0)\"";
            ClassString = "BtnCancel";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_cancel_Internalname, "", "Cancelar", bttBtn_cancel_Jsonclick, 1, "Cancelar", "", StyleString, ClassString, bttBtn_cancel_Visible, 1, "standard", "ECANCEL.", TempTags, "", context.GetButtonType( ), "HLP_Ingrediente.htm");
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 85,'',false,'',0)\"";
            ClassString = "BtnDelete";
            StyleString = "";
            GxWebStd.gx_button_ctrl( context, bttBtn_delete_Internalname, "", "Eliminar", bttBtn_delete_Jsonclick, 5, "Eliminar", "", StyleString, ClassString, bttBtn_delete_Visible, 1, "standard", "EDELETE.", TempTags, "", context.GetButtonType( ), "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table3_28_046e( true) ;
         }
         else
         {
            wb_table3_28_046e( false) ;
         }
      }

      protected void wb_table4_34_046( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable2_Internalname, tblTable2_Internalname, "", "Table", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredienteid_Internalname, "Id", "", "", lblTextblockingredienteid_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 39,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A24IngredienteId), 10, 0, ",", "")), ((edtIngredienteId_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( (decimal)(A24IngredienteId), "ZZZZZZZZZ9")) : context.localUtil.Format( (decimal)(A24IngredienteId), "ZZZZZZZZZ9")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(39);\"", "", "", "", "", "", edtIngredienteId_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteId_Enabled, 0, "text", "", 10, "chr", 1, "row", 10, 0, 0, 0, 1, -1, 0, true, "Id", "right", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredientedescripcion_Internalname, "Descripcion", "", "", lblTextblockingredientedescripcion_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Multiple line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 44,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_html_textarea( context, edtIngredienteDescripcion_Internalname, StringUtil.RTrim( A27IngredienteDescripcion), "", TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(44);\"", 0, 1, edtIngredienteDescripcion_Enabled, 0, 80, "chr", 3, "row", StyleString, ClassString, "200", -1, "", "", -1, true, "Descripcion", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredientecosto_Internalname, "Costo", "", "", lblTextblockingredientecosto_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 49,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteCosto_Internalname, StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ",", "")), ((edtIngredienteCosto_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A26IngredienteCosto, "Z9.99")) : context.localUtil.Format( A26IngredienteCosto, "Z9.99")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_decimal( this, '.',',','2');"+";gx.evt.onblur(49);\"", "", "", "", "", "", edtIngredienteCosto_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteCosto_Enabled, 0, "text", "", 5, "chr", 1, "row", 5, 0, 0, 0, 1, -1, 0, true, "Precio", "right", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredienteunidadmedida_Internalname, "Unidad Medida", "", "", lblTextblockingredienteunidadmedida_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 54,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteUnidadMedida_Internalname, StringUtil.RTrim( A28IngredienteUnidadMedida), StringUtil.RTrim( context.localUtil.Format( A28IngredienteUnidadMedida, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(54);\"", "", "", "", "", "", edtIngredienteUnidadMedida_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteUnidadMedida_Enabled, 0, "text", "", 20, "chr", 1, "row", 20, 0, 0, 0, 1, -1, -1, true, "", "left", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredientestock_Internalname, "Stock", "", "", lblTextblockingredientestock_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 59,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteStock_Internalname, StringUtil.LTrim( StringUtil.NToC( A29IngredienteStock, 6, 3, ",", "")), ((edtIngredienteStock_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A29IngredienteStock, "Z9.999")) : context.localUtil.Format( A29IngredienteStock, "Z9.999")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_decimal( this, '.',',','3');"+";gx.evt.onblur(59);\"", "", "", "", "", "", edtIngredienteStock_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteStock_Enabled, 0, "text", "", 6, "chr", 1, "row", 6, 0, 0, 0, 1, -1, 0, true, "Stock", "right", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredienteestado_Internalname, "Estado", "", "", lblTextblockingredienteestado_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 64,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteEstado_Internalname, StringUtil.RTrim( A30IngredienteEstado), StringUtil.RTrim( context.localUtil.Format( A30IngredienteEstado, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(64);\"", "", "", "", "", "", edtIngredienteEstado_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteEstado_Enabled, 0, "text", "", 1, "chr", 1, "row", 1, 0, 0, 0, 1, -1, -1, true, "Estado", "left", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"td5\"  style=\"vertical-align:top\">") ;
            /* Text block */
            ClassString = "TextBlock";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTextblockingredientetipo_Internalname, "Tipo", "", "", lblTextblockingredientetipo_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "<td>") ;
            /* Single line edit */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 69,'',false,'',0)\"";
            ClassString = "Attribute";
            StyleString = "";
            GxWebStd.gx_single_line_edit( context, edtIngredienteTipo_Internalname, StringUtil.RTrim( A31IngredienteTipo), StringUtil.RTrim( context.localUtil.Format( A31IngredienteTipo, "")), TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(69);\"", "", "", "", "", "", edtIngredienteTipo_Jsonclick, 0, ClassString, StyleString, "", 1, edtIngredienteTipo_Enabled, 0, "text", "", 20, "chr", 1, "row", 20, 0, 0, 0, 1, -1, -1, true, "", "left", "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td colspan=\"2\" >") ;
            context.WriteHtmlText( "<br/>") ;
            wb_table5_72_046( true) ;
         }
         return  ;
      }

      protected void wb_table5_72_046e( bool wbgen )
      {
         if ( wbgen )
         {
            context.WriteHtmlText( "<hr class=\"HRDefault\"/>") ;
            /*  Grid Control  */
            Gridingrediente_precioContainer.AddObjectProperty("GridName", "Gridingrediente_precio");
            Gridingrediente_precioContainer.AddObjectProperty("Class", "Grid");
            Gridingrediente_precioContainer.AddObjectProperty("Cellpadding", StringUtil.LTrim( StringUtil.NToC( (decimal)(1), 4, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Cellspacing", StringUtil.LTrim( StringUtil.NToC( (decimal)(2), 4, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Backcolorstyle", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Backcolorstyle), 1, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("CmpContext", "");
            Gridingrediente_precioContainer.AddObjectProperty("InMasterPage", "false");
            Gridingrediente_precioColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridingrediente_precioColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( (decimal)(A32ProveedorId), 10, 0, ".", "")));
            Gridingrediente_precioColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProveedorId_Enabled), 5, 0, ".", "")));
            Gridingrediente_precioContainer.AddColumnProperties(Gridingrediente_precioColumn);
            Gridingrediente_precioColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridingrediente_precioContainer.AddColumnProperties(Gridingrediente_precioColumn);
            Gridingrediente_precioColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridingrediente_precioColumn.AddObjectProperty("Value", context.localUtil.Format(A34IngredientePrecioFechaVigencia, "99/99/99"));
            Gridingrediente_precioColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioFechaVigencia_Enabled), 5, 0, ".", "")));
            Gridingrediente_precioContainer.AddColumnProperties(Gridingrediente_precioColumn);
            Gridingrediente_precioColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridingrediente_precioColumn.AddObjectProperty("Value", StringUtil.LTrim( StringUtil.NToC( A35IngredientePrecioImporte, 5, 2, ".", "")));
            Gridingrediente_precioColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioImporte_Enabled), 5, 0, ".", "")));
            Gridingrediente_precioContainer.AddColumnProperties(Gridingrediente_precioColumn);
            Gridingrediente_precioColumn = GXWebColumn.GetNew(isAjaxCallMode( ));
            Gridingrediente_precioColumn.AddObjectProperty("Value", StringUtil.RTrim( A36IngredientePrecioEstado));
            Gridingrediente_precioColumn.AddObjectProperty("Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioEstado_Enabled), 5, 0, ".", "")));
            Gridingrediente_precioContainer.AddColumnProperties(Gridingrediente_precioColumn);
            Gridingrediente_precioContainer.AddObjectProperty("Allowselection", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Allowselection), 1, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Selectioncolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Selectioncolor), 9, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Allowhover", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Allowhovering), 1, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Hovercolor", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Hoveringcolor), 9, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Allowcollapsing", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Allowcollapsing), 1, 0, ".", "")));
            Gridingrediente_precioContainer.AddObjectProperty("Collapsed", StringUtil.LTrim( StringUtil.NToC( (decimal)(subGridingrediente_precio_Collapsed), 1, 0, ".", "")));
            nGXsfl_76_idx = 0;
            if ( ( nKeyPressed == 1 ) && ( AnyError == 0 ) )
            {
               /* Enter key processing. */
               nBlankRcdCount9 = 5;
               if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
               {
                  /* Display confirmed (stored) records */
                  nRcdExists_9 = 1;
                  ScanStart049( ) ;
                  while ( RcdFound9 != 0 )
                  {
                     init_level_properties9( ) ;
                     getByPrimaryKey049( ) ;
                     AddRow049( ) ;
                     ScanNext049( ) ;
                  }
                  ScanEnd049( ) ;
                  nBlankRcdCount9 = 5;
               }
            }
            else if ( ( nKeyPressed == 3 ) || ( nKeyPressed == 4 ) || ( ( nKeyPressed == 1 ) && ( AnyError != 0 ) ) )
            {
               /* Button check  or addlines. */
               standaloneNotModal049( ) ;
               standaloneModal049( ) ;
               sMode9 = Gx_mode;
               while ( nGXsfl_76_idx < nRC_Gridingrediente_precio )
               {
                  ReadRow049( ) ;
                  edtProveedorId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PROVEEDORID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtIngredientePrecioFechaVigencia_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtIngredientePrecioImporte_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  edtIngredientePrecioEstado_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
                  imgprompt_32_Link = cgiGet( "PROMPT_32_"+sGXsfl_76_idx+"Link");
                  if ( ( nRcdExists_9 == 0 ) && ( StringUtil.StrCmp(Gx_mode, "INS") != 0 ) )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     standaloneModal049( ) ;
                  }
                  SendRow049( ) ;
               }
               Gx_mode = sMode9;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            }
            else
            {
               /* Get or get-alike key processing. */
               nBlankRcdCount9 = 5;
               nRcdExists_9 = 1;
               ScanStart049( ) ;
               while ( RcdFound9 != 0 )
               {
                  init_level_properties9( ) ;
                  standaloneNotModal049( ) ;
                  getByPrimaryKey049( ) ;
                  standaloneModal049( ) ;
                  AddRow049( ) ;
                  ScanNext049( ) ;
               }
               ScanEnd049( ) ;
            }
            /* Initialize fields for 'new' records and send them. */
            sMode9 = Gx_mode;
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            InitAll049( ) ;
            init_level_properties9( ) ;
            standaloneNotModal049( ) ;
            standaloneModal049( ) ;
            nRcdExists_9 = 0;
            nIsMod_9 = 0;
            nBlankRcdCount9 = (short)(nBlankRcdUsr9+nBlankRcdCount9);
            fRowAdded = 0;
            while ( nBlankRcdCount9 > 0 )
            {
               AddRow049( ) ;
               if ( ( nKeyPressed == 4 ) && ( fRowAdded == 0 ) )
               {
                  fRowAdded = 1;
                  GX_FocusControl = edtProveedorId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               nBlankRcdCount9 = (short)(nBlankRcdCount9-1);
            }
            Gx_mode = sMode9;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            sStyleString = " style=\"display:none;\"";
            sStyleString = "";
            context.WriteHtmlText( "<div id=\""+"Gridingrediente_precioContainer"+"Div\" "+sStyleString+">"+"</div>") ;
            context.httpAjaxContext.ajax_rsp_assign_grid("_"+"Gridingrediente_precio", (Object)(Gridingrediente_precioContainer));
            if ( ! context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridingrediente_precioContainerData", Gridingrediente_precioContainer.ToJavascriptSource());
            }
            if ( context.isAjaxRequest( ) )
            {
               GxWebStd.gx_hidden_field( context, "Gridingrediente_precioContainerData"+"V", Gridingrediente_precioContainer.GridValuesHidden());
            }
            else
            {
               context.WriteHtmlText( "<input type=\"hidden\" "+"name=\""+"Gridingrediente_precioContainerData"+"V"+"\" value='"+Gridingrediente_precioContainer.GridValuesHidden()+"'/>") ;
            }
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table4_34_046e( true) ;
         }
         else
         {
            wb_table4_34_046e( false) ;
         }
      }

      protected void wb_table5_72_046( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTable3_Internalname, tblTable3_Internalname, "", "Table95", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td class=\"SubTitle\" >") ;
            /* Text block */
            ClassString = "";
            StyleString = "";
            GxWebStd.gx_label_ctrl( context, lblTitleprecio_Internalname, "Precio", "", "", lblTitleprecio_Jsonclick, "", StyleString, ClassString, 0, "", 1, 1, 0, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table5_72_046e( true) ;
         }
         else
         {
            wb_table5_72_046e( false) ;
         }
      }

      protected void wb_table2_5_046( bool wbgen )
      {
         if ( wbgen )
         {
            /* Table start */
            sStyleString = "";
            GxWebStd.gx_table_start( context, tblTabletoolbar_Internalname, tblTabletoolbar_Internalname, "", "ViewTable", 0, "", "", 1, 2, sStyleString, "", 0);
            context.WriteHtmlText( "<tbody>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            /* Div Control */
            ClassString = "ToolbarMain";
            StyleString = "";
            GxWebStd.gx_div_start( context, divSectiontoolbar_Internalname, 1, 0, "px", 0, "px", ClassString, "");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 9,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_Internalname, context.GetImagePath( "b9e06284-17ac-4c88-8937-5dbd84ad5d80", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_Visible, 1, "", "Primero", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 10,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_first_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_first_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_first_separator_Jsonclick, "EFIRST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 11,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_Internalname, context.GetImagePath( "7d212604-db7b-4785-9c0d-5faffe71aa33", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_Visible, 1, "", "Anterior", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 12,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_previous_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_previous_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_previous_separator_Jsonclick, "EPREVIOUS.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 13,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_Internalname, context.GetImagePath( "1ae947cf-1354-41a9-8d59-d91daebf554f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_Visible, 1, "", "Siguiente", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 14,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_next_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_next_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_next_separator_Jsonclick, "ENEXT.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 15,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_Internalname, context.GetImagePath( "29211874-e613-48e5-9011-8017d984217e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_Visible, 1, "", "Ultimo", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 16,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_last_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_last_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_last_separator_Jsonclick, "ELAST.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 17,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_Internalname, context.GetImagePath( "1ca03f75-9947-4d2c-90a4-e8ab9c5cedea", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_Visible, 1, "", "Seleccionar", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0060.aspx"+"',["+"{Ctrl:gx.dom.el('"+"INGREDIENTEID"+"'), id:'"+"INGREDIENTEID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 18,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_select_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_select_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 4, imgBtn_select_separator_Jsonclick, "ESELECT.", StyleString, ClassString, "", "", ""+TempTags, "", "gx.popup.openPrompt('"+"gx0060.aspx"+"',["+"{Ctrl:gx.dom.el('"+"INGREDIENTEID"+"'), id:'"+"INGREDIENTEID"+"'"+",IOType:'out',isKey:true,isLastKey:true}"+"],"+"null"+","+"'', false"+","+"true"+");"+"return false;", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 19,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_Internalname, context.GetImagePath( "2061cf2c-bd33-4433-a13e-34af954142e9", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_Visible, imgBtn_enter2_Enabled, "", "Confirmar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 20,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_enter2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_enter2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_enter2_separator_Jsonclick, "EENTER.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 21,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_Internalname, context.GetImagePath( "0e94ced8-bc34-47ff-9a53-bc683736a686", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_Visible, 1, "", "Cancelar", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 22,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_cancel2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_cancel2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 1, imgBtn_cancel2_separator_Jsonclick, "ECANCEL.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 23,'',false,'',0)\"";
            ClassString = "ImageHandCenter";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_Internalname, context.GetImagePath( "7695fe89-52c9-4b7e-871e-0e11548f823e", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_Visible, imgBtn_delete2_Enabled, "", "Eliminar", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            /* Active images/pictures */
            TempTags = "  onfocus=\"gx.evt.onfocus(this, 24,'',false,'',0)\"";
            ClassString = "ImageTop";
            StyleString = "";
            GxWebStd.gx_bitmap( context, imgBtn_delete2_separator_Internalname, context.GetImagePath( "ea7811ba-4fa2-42da-8591-e6cb10669f1f", "", context.GetTheme( )), "", "", "", context.GetTheme( ), imgBtn_delete2_separator_Visible, 1, "", "", 0, 0, 0, "px", 0, "px", 0, 0, 5, imgBtn_delete2_separator_Jsonclick, "EDELETE.", StyleString, ClassString, "", "", ""+TempTags, "", "", 1, false, false, "HLP_Ingrediente.htm");
            context.WriteHtmlText( "</div>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "<tr>") ;
            context.WriteHtmlText( "<td>") ;
            context.WriteHtmlText( "</td>") ;
            context.WriteHtmlText( "</tr>") ;
            context.WriteHtmlText( "</tbody>") ;
            /* End of table */
            context.WriteHtmlText( "</table>") ;
            wb_table2_5_046e( true) ;
         }
         else
         {
            wb_table2_5_046e( false) ;
         }
      }

      protected void UserMain( )
      {
         standaloneStartup( ) ;
      }

      protected void standaloneStartup( )
      {
         standaloneStartupServer( ) ;
         disable_std_buttons( ) ;
         enableDisable( ) ;
         Process( ) ;
      }

      protected void standaloneStartupServer( )
      {
         /* Execute Start event if defined. */
         context.wbGlbDoneStart = 0;
         context.wbGlbDoneStart = 1;
         assign_properties_default( ) ;
         if ( AnyError == 0 )
         {
            if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
            {
               /* Read saved SDTs. */
               /* Read variables values. */
               if ( ( ( context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "INGREDIENTEID");
                  AnyError = 1;
                  GX_FocusControl = edtIngredienteId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A24IngredienteId = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
               }
               else
               {
                  A24IngredienteId = (long)(context.localUtil.CToN( cgiGet( edtIngredienteId_Internalname), ",", "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
               }
               A27IngredienteDescripcion = cgiGet( edtIngredienteDescripcion_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A27IngredienteDescripcion", A27IngredienteDescripcion);
               if ( ( ( context.localUtil.CToN( cgiGet( edtIngredienteCosto_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtIngredienteCosto_Internalname), ",", ".") > 99.99m ) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "INGREDIENTECOSTO");
                  AnyError = 1;
                  GX_FocusControl = edtIngredienteCosto_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A26IngredienteCosto = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26IngredienteCosto", StringUtil.LTrim( StringUtil.Str( A26IngredienteCosto, 5, 2)));
               }
               else
               {
                  A26IngredienteCosto = context.localUtil.CToN( cgiGet( edtIngredienteCosto_Internalname), ",", ".");
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26IngredienteCosto", StringUtil.LTrim( StringUtil.Str( A26IngredienteCosto, 5, 2)));
               }
               A28IngredienteUnidadMedida = cgiGet( edtIngredienteUnidadMedida_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A28IngredienteUnidadMedida", A28IngredienteUnidadMedida);
               if ( ( ( context.localUtil.CToN( cgiGet( edtIngredienteStock_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtIngredienteStock_Internalname), ",", ".") > 99.999m ) ) )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "INGREDIENTESTOCK");
                  AnyError = 1;
                  GX_FocusControl = edtIngredienteStock_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  wbErr = true;
                  A29IngredienteStock = 0;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29IngredienteStock", StringUtil.LTrim( StringUtil.Str( A29IngredienteStock, 6, 3)));
               }
               else
               {
                  A29IngredienteStock = context.localUtil.CToN( cgiGet( edtIngredienteStock_Internalname), ",", ".");
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29IngredienteStock", StringUtil.LTrim( StringUtil.Str( A29IngredienteStock, 6, 3)));
               }
               A30IngredienteEstado = cgiGet( edtIngredienteEstado_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30IngredienteEstado", A30IngredienteEstado);
               A31IngredienteTipo = cgiGet( edtIngredienteTipo_Internalname);
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31IngredienteTipo", A31IngredienteTipo);
               /* Read saved values. */
               Z24IngredienteId = (long)(context.localUtil.CToN( cgiGet( "Z24IngredienteId"), ",", "."));
               Z27IngredienteDescripcion = cgiGet( "Z27IngredienteDescripcion");
               Z26IngredienteCosto = context.localUtil.CToN( cgiGet( "Z26IngredienteCosto"), ",", ".");
               Z28IngredienteUnidadMedida = cgiGet( "Z28IngredienteUnidadMedida");
               Z29IngredienteStock = context.localUtil.CToN( cgiGet( "Z29IngredienteStock"), ",", ".");
               Z30IngredienteEstado = cgiGet( "Z30IngredienteEstado");
               Z31IngredienteTipo = cgiGet( "Z31IngredienteTipo");
               IsConfirmed = (short)(context.localUtil.CToN( cgiGet( "IsConfirmed"), ",", "."));
               IsModified = (short)(context.localUtil.CToN( cgiGet( "IsModified"), ",", "."));
               Gx_mode = cgiGet( "Mode");
               nRC_Gridingrediente_precio = (short)(context.localUtil.CToN( cgiGet( "nRC_Gridingrediente_precio"), ",", "."));
               Gx_mode = cgiGet( "vMODE");
               /* Read subfile selected row values. */
               /* Read hidden variables. */
               GXKey = Crypto.Decrypt64( context.GetCookie( "GX_SESSION_ID"), Crypto.GetServerKey( ));
               /* Check if conditions changed and reset current page numbers */
               standaloneNotModal( ) ;
            }
            else
            {
               standaloneNotModal( ) ;
               if ( StringUtil.StrCmp(gxfirstwebparm, "viewer") == 0 )
               {
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  A24IngredienteId = (long)(NumberUtil.Val( GetNextPar( ), "."));
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
                  getEqualNoModal( ) ;
                  Gx_mode = "DSP";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  disable_std_buttons_dsp( ) ;
                  standaloneModal( ) ;
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  standaloneModal( ) ;
               }
            }
         }
      }

      protected void Process( )
      {
         if ( StringUtil.StrCmp(context.GetRequestMethod( ), "POST") == 0 )
         {
            /* Read Transaction buttons. */
            sEvt = cgiGet( "_EventName");
            EvtGridId = cgiGet( "_EventGridId");
            EvtRowId = cgiGet( "_EventRowId");
            if ( StringUtil.Len( sEvt) > 0 )
            {
               sEvtType = StringUtil.Left( sEvt, 1);
               sEvt = StringUtil.Right( sEvt, (short)(StringUtil.Len( sEvt)-1));
               if ( StringUtil.StrCmp(sEvtType, "M") != 0 )
               {
                  if ( StringUtil.StrCmp(sEvtType, "E") == 0 )
                  {
                     sEvtType = StringUtil.Right( sEvt, 1);
                     if ( StringUtil.StrCmp(sEvtType, ".") == 0 )
                     {
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-1));
                        if ( StringUtil.StrCmp(sEvt, "ENTER") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_enter( ) ;
                           /* No code required for Cancel button. It is implemented as the Reset button. */
                        }
                        else if ( StringUtil.StrCmp(sEvt, "FIRST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_first( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "PREVIOUS") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_previous( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "NEXT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_next( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LAST") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_last( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "SELECT") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_select( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "DELETE") == 0 )
                        {
                           context.wbHandled = 1;
                           btn_delete( ) ;
                        }
                        else if ( StringUtil.StrCmp(sEvt, "LSCR") == 0 )
                        {
                           context.wbHandled = 1;
                           AfterKeyLoadScreen( ) ;
                        }
                     }
                     else
                     {
                        sEvtType = StringUtil.Right( sEvt, 4);
                        sEvt = StringUtil.Left( sEvt, (short)(StringUtil.Len( sEvt)-4));
                     }
                  }
                  context.wbHandled = 1;
               }
            }
         }
      }

      protected void AfterTrn( )
      {
         if ( trnEnded == 1 )
         {
            trnEnded = 0;
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            if ( ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )  )
            {
               /* Clear variables for new insertion. */
               InitAll046( ) ;
               standaloneNotModal( ) ;
               standaloneModal( ) ;
            }
         }
      }

      public override String ToString( )
      {
         return "" ;
      }

      public GxContentInfo GetContentInfo( )
      {
         return (GxContentInfo)(null) ;
      }

      protected void disable_std_buttons( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
      }

      protected void disable_std_buttons_dsp( )
      {
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         imgBtn_first_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_Visible), 5, 0)));
         imgBtn_first_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_first_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_first_separator_Visible), 5, 0)));
         imgBtn_previous_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_Visible), 5, 0)));
         imgBtn_previous_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_previous_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_previous_separator_Visible), 5, 0)));
         imgBtn_next_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_Visible), 5, 0)));
         imgBtn_next_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_next_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_next_separator_Visible), 5, 0)));
         imgBtn_last_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_Visible), 5, 0)));
         imgBtn_last_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_last_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_last_separator_Visible), 5, 0)));
         imgBtn_select_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_Visible), 5, 0)));
         imgBtn_select_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_select_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_select_separator_Visible), 5, 0)));
         imgBtn_delete2_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Visible), 5, 0)));
         imgBtn_delete2_separator_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_separator_Visible), 5, 0)));
         bttBtn_delete_Visible = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_delete_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_delete_Visible), 5, 0)));
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Visible), 5, 0)));
            imgBtn_enter2_separator_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_separator_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_separator_Visible), 5, 0)));
            bttBtn_enter_Visible = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, bttBtn_enter_Internalname, "Visible", StringUtil.LTrim( StringUtil.Str( (decimal)(bttBtn_enter_Visible), 5, 0)));
         }
         DisableAttributes046( ) ;
      }

      protected void set_caption( )
      {
         if ( ( IsConfirmed == 1 ) && ( AnyError == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_confdelete", ""), 0, "");
            }
            else
            {
               GX_msglist.addItem(context.GetMessage( "GXM_mustconfirm", ""), 0, "");
            }
         }
      }

      protected void CONFIRM_049( )
      {
         nGXsfl_76_idx = 0;
         while ( nGXsfl_76_idx < nRC_Gridingrediente_precio )
         {
            ReadRow049( ) ;
            if ( ( nRcdExists_9 != 0 ) || ( nIsMod_9 != 0 ) )
            {
               GetKey049( ) ;
               if ( ( nRcdExists_9 == 0 ) && ( nRcdDeleted_9 == 0 ) )
               {
                  if ( RcdFound9 == 0 )
                  {
                     Gx_mode = "INS";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                     BeforeValidate049( ) ;
                     if ( AnyError == 0 )
                     {
                        CheckExtendedTable049( ) ;
                        CloseExtendedTableCursors049( ) ;
                        if ( AnyError == 0 )
                        {
                           IsConfirmed = 1;
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "PROVEEDORID");
                     AnyError = 1;
                     GX_FocusControl = edtProveedorId_Internalname;
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
               else
               {
                  if ( RcdFound9 != 0 )
                  {
                     if ( nRcdDeleted_9 != 0 )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        getByPrimaryKey049( ) ;
                        Load049( ) ;
                        BeforeValidate049( ) ;
                        if ( AnyError == 0 )
                        {
                           OnDeleteControls049( ) ;
                        }
                     }
                     else
                     {
                        if ( nIsMod_9 != 0 )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           BeforeValidate049( ) ;
                           if ( AnyError == 0 )
                           {
                              CheckExtendedTable049( ) ;
                              CloseExtendedTableCursors049( ) ;
                              if ( AnyError == 0 )
                              {
                                 IsConfirmed = 1;
                              }
                           }
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_9 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PROVEEDORID");
                        AnyError = 1;
                        GX_FocusControl = edtProveedorId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
            }
            ChangePostValue( edtProveedorId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A32ProveedorId), 10, 0, ",", ""))) ;
            ChangePostValue( edtIngredientePrecioFechaVigencia_Internalname, context.localUtil.Format(A34IngredientePrecioFechaVigencia, "99/99/99")) ;
            ChangePostValue( edtIngredientePrecioImporte_Internalname, StringUtil.LTrim( StringUtil.NToC( A35IngredientePrecioImporte, 5, 2, ",", ""))) ;
            ChangePostValue( edtIngredientePrecioEstado_Internalname, StringUtil.RTrim( A36IngredientePrecioEstado)) ;
            ChangePostValue( "ZT_"+"Z32ProveedorId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z32ProveedorId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z34IngredientePrecioFechaVigencia_"+sGXsfl_76_idx, context.localUtil.DToC( Z34IngredientePrecioFechaVigencia, 0, "/")) ;
            ChangePostValue( "ZT_"+"Z35IngredientePrecioImporte_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( Z35IngredientePrecioImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z36IngredientePrecioEstado_"+sGXsfl_76_idx, StringUtil.RTrim( Z36IngredientePrecioEstado)) ;
            ChangePostValue( "nRcdDeleted_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_9), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_9), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_9), 4, 0, ",", ""))) ;
            if ( nIsMod_9 != 0 )
            {
               ChangePostValue( "PROVEEDORID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProveedorId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioFechaVigencia_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioImporte_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioEstado_Enabled), 5, 0, ".", ""))) ;
            }
         }
         /* Start of After( level) rules */
         /* End of After( level) rules */
      }

      protected void ResetCaption040( )
      {
      }

      protected void ZM046( short GX_JID )
      {
         if ( ( GX_JID == 2 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z27IngredienteDescripcion = T00046_A27IngredienteDescripcion[0];
               Z26IngredienteCosto = T00046_A26IngredienteCosto[0];
               Z28IngredienteUnidadMedida = T00046_A28IngredienteUnidadMedida[0];
               Z29IngredienteStock = T00046_A29IngredienteStock[0];
               Z30IngredienteEstado = T00046_A30IngredienteEstado[0];
               Z31IngredienteTipo = T00046_A31IngredienteTipo[0];
            }
            else
            {
               Z27IngredienteDescripcion = A27IngredienteDescripcion;
               Z26IngredienteCosto = A26IngredienteCosto;
               Z28IngredienteUnidadMedida = A28IngredienteUnidadMedida;
               Z29IngredienteStock = A29IngredienteStock;
               Z30IngredienteEstado = A30IngredienteEstado;
               Z31IngredienteTipo = A31IngredienteTipo;
            }
         }
         if ( GX_JID == -2 )
         {
            Z24IngredienteId = A24IngredienteId;
            Z27IngredienteDescripcion = A27IngredienteDescripcion;
            Z26IngredienteCosto = A26IngredienteCosto;
            Z28IngredienteUnidadMedida = A28IngredienteUnidadMedida;
            Z29IngredienteStock = A29IngredienteStock;
            Z30IngredienteEstado = A30IngredienteEstado;
            Z31IngredienteTipo = A31IngredienteTipo;
         }
      }

      protected void standaloneNotModal( )
      {
      }

      protected void standaloneModal( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
         {
            imgBtn_delete2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_delete2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_delete2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_delete2_Enabled), 5, 0)));
         }
         if ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 )
         {
            imgBtn_enter2_Enabled = 0;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
         else
         {
            imgBtn_enter2_Enabled = 1;
            context.httpAjaxContext.ajax_rsp_assign_prop("", false, imgBtn_enter2_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(imgBtn_enter2_Enabled), 5, 0)));
         }
      }

      protected void Load046( )
      {
         /* Using cursor T00047 */
         pr_default.execute(5, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(5) != 101) )
         {
            RcdFound6 = 1;
            A27IngredienteDescripcion = T00047_A27IngredienteDescripcion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A27IngredienteDescripcion", A27IngredienteDescripcion);
            A26IngredienteCosto = T00047_A26IngredienteCosto[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26IngredienteCosto", StringUtil.LTrim( StringUtil.Str( A26IngredienteCosto, 5, 2)));
            A28IngredienteUnidadMedida = T00047_A28IngredienteUnidadMedida[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A28IngredienteUnidadMedida", A28IngredienteUnidadMedida);
            A29IngredienteStock = T00047_A29IngredienteStock[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29IngredienteStock", StringUtil.LTrim( StringUtil.Str( A29IngredienteStock, 6, 3)));
            A30IngredienteEstado = T00047_A30IngredienteEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30IngredienteEstado", A30IngredienteEstado);
            A31IngredienteTipo = T00047_A31IngredienteTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31IngredienteTipo", A31IngredienteTipo);
            ZM046( -2) ;
         }
         pr_default.close(5);
         OnLoadActions046( ) ;
      }

      protected void OnLoadActions046( )
      {
      }

      protected void CheckExtendedTable046( )
      {
         Gx_BScreen = 1;
         standaloneModal( ) ;
      }

      protected void CloseExtendedTableCursors046( )
      {
      }

      protected void enableDisable( )
      {
      }

      protected void GetKey046( )
      {
         /* Using cursor T00048 */
         pr_default.execute(6, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(6) != 101) )
         {
            RcdFound6 = 1;
         }
         else
         {
            RcdFound6 = 0;
         }
         pr_default.close(6);
      }

      protected void getByPrimaryKey( )
      {
         /* Using cursor T00046 */
         pr_default.execute(4, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(4) != 101) )
         {
            ZM046( 2) ;
            RcdFound6 = 1;
            A24IngredienteId = T00046_A24IngredienteId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
            A27IngredienteDescripcion = T00046_A27IngredienteDescripcion[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A27IngredienteDescripcion", A27IngredienteDescripcion);
            A26IngredienteCosto = T00046_A26IngredienteCosto[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26IngredienteCosto", StringUtil.LTrim( StringUtil.Str( A26IngredienteCosto, 5, 2)));
            A28IngredienteUnidadMedida = T00046_A28IngredienteUnidadMedida[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A28IngredienteUnidadMedida", A28IngredienteUnidadMedida);
            A29IngredienteStock = T00046_A29IngredienteStock[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29IngredienteStock", StringUtil.LTrim( StringUtil.Str( A29IngredienteStock, 6, 3)));
            A30IngredienteEstado = T00046_A30IngredienteEstado[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30IngredienteEstado", A30IngredienteEstado);
            A31IngredienteTipo = T00046_A31IngredienteTipo[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31IngredienteTipo", A31IngredienteTipo);
            Z24IngredienteId = A24IngredienteId;
            sMode6 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Load046( ) ;
            if ( AnyError == 1 )
            {
               RcdFound6 = 0;
               InitializeNonKey046( ) ;
            }
            Gx_mode = sMode6;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound6 = 0;
            InitializeNonKey046( ) ;
            sMode6 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal( ) ;
            Gx_mode = sMode6;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         pr_default.close(4);
      }

      protected void getEqualNoModal( )
      {
         GetKey046( ) ;
         if ( RcdFound6 == 0 )
         {
            Gx_mode = "INS";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         getByPrimaryKey( ) ;
      }

      protected void move_next( )
      {
         RcdFound6 = 0;
         /* Using cursor T00049 */
         pr_default.execute(7, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(7) != 101) )
         {
            while ( (pr_default.getStatus(7) != 101) && ( ( T00049_A24IngredienteId[0] < A24IngredienteId ) ) )
            {
               pr_default.readNext(7);
            }
            if ( (pr_default.getStatus(7) != 101) && ( ( T00049_A24IngredienteId[0] > A24IngredienteId ) ) )
            {
               A24IngredienteId = T00049_A24IngredienteId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
               RcdFound6 = 1;
            }
         }
         pr_default.close(4);
      }

      protected void move_previous( )
      {
         RcdFound6 = 0;
         /* Using cursor T000410 */
         pr_default.execute(8, new Object[] {A24IngredienteId});
         if ( (pr_default.getStatus(8) != 101) )
         {
            while ( (pr_default.getStatus(8) != 101) && ( ( T000410_A24IngredienteId[0] > A24IngredienteId ) ) )
            {
               pr_default.readNext(8);
            }
            if ( (pr_default.getStatus(8) != 101) && ( ( T000410_A24IngredienteId[0] < A24IngredienteId ) ) )
            {
               A24IngredienteId = T000410_A24IngredienteId[0];
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
               RcdFound6 = 1;
            }
         }
         pr_default.close(3);
      }

      protected void btn_enter( )
      {
         nKeyPressed = 1;
         GetKey046( ) ;
         if ( RcdFound6 == 1 )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") == 0 )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "INGREDIENTEID");
               AnyError = 1;
               GX_FocusControl = edtIngredienteId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( A24IngredienteId != Z24IngredienteId )
            {
               A24IngredienteId = Z24IngredienteId;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
               GX_msglist.addItem(context.GetMessage( "GXM_getbeforeupd", ""), "CandidateKeyNotFound", 1, "INGREDIENTEID");
               AnyError = 1;
               GX_FocusControl = edtIngredienteId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else if ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 )
            {
               delete( ) ;
               AfterTrn( ) ;
               GX_FocusControl = edtIngredienteId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
            else
            {
               Gx_mode = "UPD";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Update record */
               Update046( ) ;
               GX_FocusControl = edtIngredienteId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            }
         }
         else
         {
            if ( A24IngredienteId != Z24IngredienteId )
            {
               Gx_mode = "INS";
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
               /* Insert record */
               GX_FocusControl = edtIngredienteId_Internalname;
               context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               Insert046( ) ;
               if ( AnyError == 1 )
               {
                  GX_FocusControl = "";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
            }
            else
            {
               if ( StringUtil.StrCmp(Gx_mode, "UPD") == 0 )
               {
                  GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "INGREDIENTEID");
                  AnyError = 1;
                  GX_FocusControl = edtIngredienteId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
               }
               else
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  /* Insert record */
                  GX_FocusControl = edtIngredienteId_Internalname;
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  Insert046( ) ;
                  if ( AnyError == 1 )
                  {
                     GX_FocusControl = "";
                     context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                  }
               }
            }
         }
         AfterTrn( ) ;
      }

      protected void btn_delete( )
      {
         if ( A24IngredienteId != Z24IngredienteId )
         {
            A24IngredienteId = Z24IngredienteId;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
            GX_msglist.addItem(context.GetMessage( "GXM_getbeforedlt", ""), 1, "INGREDIENTEID");
            AnyError = 1;
            GX_FocusControl = edtIngredienteId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         else
         {
            delete( ) ;
            AfterTrn( ) ;
            GX_FocusControl = edtIngredienteId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         if ( AnyError != 0 )
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            getByPrimaryKey( ) ;
         }
         CloseOpenCursors();
      }

      protected void btn_get( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         if ( RcdFound6 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_keynfound", ""), "PrimaryKeyNotFound", 1, "INGREDIENTEID");
            AnyError = 1;
         }
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_first( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart046( ) ;
         if ( RcdFound6 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd046( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_previous( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_previous( ) ;
         if ( RcdFound6 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_next( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         move_next( ) ;
         if ( RcdFound6 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_last( )
      {
         nKeyPressed = 2;
         IsConfirmed = 0;
         ScanStart046( ) ;
         if ( RcdFound6 == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_norectobrow", ""), 0, "");
         }
         else
         {
            while ( RcdFound6 != 0 )
            {
               ScanNext046( ) ;
            }
            Gx_mode = "UPD";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         ScanEnd046( ) ;
         getByPrimaryKey( ) ;
         standaloneNotModal( ) ;
         standaloneModal( ) ;
      }

      protected void btn_select( )
      {
         getEqualNoModal( ) ;
      }

      protected void CheckOptimisticConcurrency046( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T000411 */
            pr_default.execute(9, new Object[] {A24IngredienteId});
            if ( (pr_default.getStatus(9) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Ingrediente"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            Gx_longc = false;
            if ( (pr_default.getStatus(9) == 101) || ( StringUtil.StrCmp(Z27IngredienteDescripcion, T000411_A27IngredienteDescripcion[0]) != 0 ) || ( Z26IngredienteCosto != T000411_A26IngredienteCosto[0] ) || ( StringUtil.StrCmp(Z28IngredienteUnidadMedida, T000411_A28IngredienteUnidadMedida[0]) != 0 ) || ( Z29IngredienteStock != T000411_A29IngredienteStock[0] ) || ( StringUtil.StrCmp(Z30IngredienteEstado, T000411_A30IngredienteEstado[0]) != 0 ) )
            {
               Gx_longc = true;
            }
            if ( Gx_longc || ( StringUtil.StrCmp(Z31IngredienteTipo, T000411_A31IngredienteTipo[0]) != 0 ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"Ingrediente"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert046( )
      {
         BeforeValidate046( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable046( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM046( 0) ;
            CheckOptimisticConcurrency046( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm046( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert046( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000412 */
                     pr_default.execute(10, new Object[] {A24IngredienteId, A27IngredienteDescripcion, A26IngredienteCosto, A28IngredienteUnidadMedida, A29IngredienteStock, A30IngredienteEstado, A31IngredienteTipo});
                     pr_default.close(10);
                     dsDefault.SmartCacheProvider.SetUpdated("Ingrediente") ;
                     if ( (pr_default.getStatus(10) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel046( ) ;
                           if ( AnyError == 0 )
                           {
                              /* Save values for previous() function. */
                              GX_msglist.addItem(context.GetMessage( "GXM_sucadded", ""), 0, "");
                              ResetCaption040( ) ;
                           }
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load046( ) ;
            }
            EndLevel046( ) ;
         }
         CloseExtendedTableCursors046( ) ;
      }

      protected void Update046( )
      {
         BeforeValidate046( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable046( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency046( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm046( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate046( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000413 */
                     pr_default.execute(11, new Object[] {A27IngredienteDescripcion, A26IngredienteCosto, A28IngredienteUnidadMedida, A29IngredienteStock, A30IngredienteEstado, A31IngredienteTipo, A24IngredienteId});
                     pr_default.close(11);
                     dsDefault.SmartCacheProvider.SetUpdated("Ingrediente") ;
                     if ( (pr_default.getStatus(11) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"Ingrediente"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate046( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           ProcessLevel046( ) ;
                           if ( AnyError == 0 )
                           {
                              getByPrimaryKey( ) ;
                              GX_msglist.addItem(context.GetMessage( "GXM_sucupdated", ""), 0, "");
                              ResetCaption040( ) ;
                           }
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel046( ) ;
         }
         CloseExtendedTableCursors046( ) ;
      }

      protected void DeferredUpdate046( )
      {
      }

      protected void delete( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate046( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency046( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls046( ) ;
            AfterConfirm046( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete046( ) ;
               if ( AnyError == 0 )
               {
                  ScanStart049( ) ;
                  while ( RcdFound9 != 0 )
                  {
                     getByPrimaryKey049( ) ;
                     Delete049( ) ;
                     ScanNext049( ) ;
                  }
                  ScanEnd049( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000414 */
                     pr_default.execute(12, new Object[] {A24IngredienteId});
                     pr_default.close(12);
                     dsDefault.SmartCacheProvider.SetUpdated("Ingrediente") ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( delete) rules */
                        /* End of After( delete) rules */
                        if ( AnyError == 0 )
                        {
                           move_next( ) ;
                           if ( RcdFound6 == 0 )
                           {
                              InitAll046( ) ;
                              Gx_mode = "INS";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           else
                           {
                              getByPrimaryKey( ) ;
                              Gx_mode = "UPD";
                              context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           }
                           GX_msglist.addItem(context.GetMessage( "GXM_sucdeleted", ""), 0, "");
                           ResetCaption040( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
         }
         sMode6 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel046( ) ;
         Gx_mode = sMode6;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls046( )
      {
         standaloneModal( ) ;
         /* No delete mode formulas found. */
         if ( AnyError == 0 )
         {
            /* Using cursor T000415 */
            pr_default.execute(13, new Object[] {A24IngredienteId});
            if ( (pr_default.getStatus(13) != 101) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_del", new   object[]  {"Ingrediente"}), "CannotDeleteReferencedRecord", 1, "");
               AnyError = 1;
            }
            pr_default.close(13);
         }
      }

      protected void ProcessNestedLevel049( )
      {
         nGXsfl_76_idx = 0;
         while ( nGXsfl_76_idx < nRC_Gridingrediente_precio )
         {
            ReadRow049( ) ;
            if ( ( nRcdExists_9 != 0 ) || ( nIsMod_9 != 0 ) )
            {
               standaloneNotModal049( ) ;
               GetKey049( ) ;
               if ( ( nRcdExists_9 == 0 ) && ( nRcdDeleted_9 == 0 ) )
               {
                  Gx_mode = "INS";
                  context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                  Insert049( ) ;
               }
               else
               {
                  if ( RcdFound9 != 0 )
                  {
                     if ( ( nRcdDeleted_9 != 0 ) && ( nRcdExists_9 != 0 ) )
                     {
                        Gx_mode = "DLT";
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                        Delete049( ) ;
                     }
                     else
                     {
                        if ( ( nIsMod_9 != 0 ) && ( nRcdExists_9 != 0 ) )
                        {
                           Gx_mode = "UPD";
                           context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
                           Update049( ) ;
                        }
                     }
                  }
                  else
                  {
                     if ( nRcdDeleted_9 == 0 )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_recdeleted", ""), 1, "PROVEEDORID");
                        AnyError = 1;
                        GX_FocusControl = edtProveedorId_Internalname;
                        context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
                     }
                  }
               }
            }
            ChangePostValue( edtProveedorId_Internalname, StringUtil.LTrim( StringUtil.NToC( (decimal)(A32ProveedorId), 10, 0, ",", ""))) ;
            ChangePostValue( edtIngredientePrecioFechaVigencia_Internalname, context.localUtil.Format(A34IngredientePrecioFechaVigencia, "99/99/99")) ;
            ChangePostValue( edtIngredientePrecioImporte_Internalname, StringUtil.LTrim( StringUtil.NToC( A35IngredientePrecioImporte, 5, 2, ",", ""))) ;
            ChangePostValue( edtIngredientePrecioEstado_Internalname, StringUtil.RTrim( A36IngredientePrecioEstado)) ;
            ChangePostValue( "ZT_"+"Z32ProveedorId_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z32ProveedorId), 10, 0, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z34IngredientePrecioFechaVigencia_"+sGXsfl_76_idx, context.localUtil.DToC( Z34IngredientePrecioFechaVigencia, 0, "/")) ;
            ChangePostValue( "ZT_"+"Z35IngredientePrecioImporte_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( Z35IngredientePrecioImporte, 5, 2, ",", ""))) ;
            ChangePostValue( "ZT_"+"Z36IngredientePrecioEstado_"+sGXsfl_76_idx, StringUtil.RTrim( Z36IngredientePrecioEstado)) ;
            ChangePostValue( "nRcdDeleted_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_9), 4, 0, ",", ""))) ;
            ChangePostValue( "nRcdExists_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_9), 4, 0, ",", ""))) ;
            ChangePostValue( "nIsMod_9_"+sGXsfl_76_idx, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_9), 4, 0, ",", ""))) ;
            if ( nIsMod_9 != 0 )
            {
               ChangePostValue( "PROVEEDORID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProveedorId_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioFechaVigencia_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioImporte_Enabled), 5, 0, ".", ""))) ;
               ChangePostValue( "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioEstado_Enabled), 5, 0, ".", ""))) ;
            }
         }
         /* Start of After( level) rules */
         /* End of After( level) rules */
         InitAll049( ) ;
         if ( AnyError != 0 )
         {
         }
         nRcdExists_9 = 0;
         nIsMod_9 = 0;
         nRcdDeleted_9 = 0;
      }

      protected void ProcessLevel046( )
      {
         /* Save parent mode. */
         sMode6 = Gx_mode;
         ProcessNestedLevel049( ) ;
         if ( AnyError != 0 )
         {
         }
         /* Restore parent mode. */
         Gx_mode = sMode6;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         /* ' Update level parameters */
      }

      protected void EndLevel046( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(9);
         }
         if ( AnyError == 0 )
         {
            BeforeComplete046( ) ;
         }
         if ( AnyError == 0 )
         {
            pr_default.close(8);
            pr_default.close(7);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(2);
            context.CommitDataStores("Ingrediente");
            if ( AnyError == 0 )
            {
               ConfirmValues040( ) ;
            }
            /* After transaction rules */
            /* Execute 'After Trn' event if defined. */
            trnEnded = 1;
         }
         else
         {
            pr_default.close(8);
            pr_default.close(7);
            pr_default.close(1);
            pr_default.close(0);
            pr_default.close(2);
            context.RollbackDataStores("Ingrediente");
         }
         IsModified = 0;
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart046( )
      {
         /* Using cursor T000416 */
         pr_default.execute(14);
         RcdFound6 = 0;
         if ( (pr_default.getStatus(14) != 101) )
         {
            RcdFound6 = 1;
            A24IngredienteId = T000416_A24IngredienteId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext046( )
      {
         /* Scan next routine */
         pr_default.readNext(14);
         RcdFound6 = 0;
         if ( (pr_default.getStatus(14) != 101) )
         {
            RcdFound6 = 1;
            A24IngredienteId = T000416_A24IngredienteId[0];
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
         }
      }

      protected void ScanEnd046( )
      {
      }

      protected void AfterConfirm046( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert046( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate046( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete046( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete046( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate046( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes046( )
      {
         edtIngredienteId_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteId_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteId_Enabled), 5, 0)));
         edtIngredienteDescripcion_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteDescripcion_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteDescripcion_Enabled), 5, 0)));
         edtIngredienteCosto_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteCosto_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteCosto_Enabled), 5, 0)));
         edtIngredienteUnidadMedida_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteUnidadMedida_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteUnidadMedida_Enabled), 5, 0)));
         edtIngredienteStock_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteStock_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteStock_Enabled), 5, 0)));
         edtIngredienteEstado_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteEstado_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteEstado_Enabled), 5, 0)));
         edtIngredienteTipo_Enabled = 0;
         context.httpAjaxContext.ajax_rsp_assign_prop("", false, edtIngredienteTipo_Internalname, "Enabled", StringUtil.LTrim( StringUtil.Str( (decimal)(edtIngredienteTipo_Enabled), 5, 0)));
      }

      protected void ZM049( short GX_JID )
      {
         if ( ( GX_JID == 3 ) || ( GX_JID == 0 ) )
         {
            if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
            {
               Z35IngredientePrecioImporte = T00043_A35IngredientePrecioImporte[0];
               Z36IngredientePrecioEstado = T00043_A36IngredientePrecioEstado[0];
            }
            else
            {
               Z35IngredientePrecioImporte = A35IngredientePrecioImporte;
               Z36IngredientePrecioEstado = A36IngredientePrecioEstado;
            }
         }
         if ( GX_JID == -3 )
         {
            Z24IngredienteId = A24IngredienteId;
            Z34IngredientePrecioFechaVigencia = A34IngredientePrecioFechaVigencia;
            Z35IngredientePrecioImporte = A35IngredientePrecioImporte;
            Z36IngredientePrecioEstado = A36IngredientePrecioEstado;
            Z32ProveedorId = A32ProveedorId;
         }
      }

      protected void standaloneNotModal049( )
      {
      }

      protected void standaloneModal049( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            edtProveedorId_Enabled = 0;
         }
         else
         {
            edtProveedorId_Enabled = 1;
         }
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            edtIngredientePrecioFechaVigencia_Enabled = 0;
         }
         else
         {
            edtIngredientePrecioFechaVigencia_Enabled = 1;
         }
      }

      protected void Load049( )
      {
         /* Using cursor T000417 */
         pr_default.execute(15, new Object[] {A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
         if ( (pr_default.getStatus(15) != 101) )
         {
            RcdFound9 = 1;
            A35IngredientePrecioImporte = T000417_A35IngredientePrecioImporte[0];
            A36IngredientePrecioEstado = T000417_A36IngredientePrecioEstado[0];
            ZM049( -3) ;
         }
         pr_default.close(15);
         OnLoadActions049( ) ;
      }

      protected void OnLoadActions049( )
      {
      }

      protected void CheckExtendedTable049( )
      {
         Gx_BScreen = 1;
         standaloneModal049( ) ;
         /* Using cursor T00044 */
         pr_default.execute(2, new Object[] {A32ProveedorId});
         if ( (pr_default.getStatus(2) == 101) )
         {
            GX_msglist.addItem("No existe 'Proveedor'.", "ForeignKeyNotFound", 1, "PROVEEDORID");
            AnyError = 1;
            GX_FocusControl = edtProveedorId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         pr_default.close(2);
         if ( ! ( (DateTime.MinValue==A34IngredientePrecioFechaVigencia) || ( A34IngredientePrecioFechaVigencia >= context.localUtil.YMDToD( 1753, 1, 1) ) ) )
         {
            GX_msglist.addItem("Campo Ingrediente Precio Fecha Vigencia fuera de rango", "OutOfRange", 1, "INGREDIENTEPRECIOFECHAVIGENCIA");
            AnyError = 1;
            GX_FocusControl = edtIngredientePrecioFechaVigencia_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
      }

      protected void CloseExtendedTableCursors049( )
      {
         pr_default.close(2);
      }

      protected void enableDisable049( )
      {
      }

      protected void gxLoad_4( long A32ProveedorId )
      {
         /* Using cursor T000418 */
         pr_default.execute(16, new Object[] {A32ProveedorId});
         if ( (pr_default.getStatus(16) == 101) )
         {
            GX_msglist.addItem("No existe 'Proveedor'.", "ForeignKeyNotFound", 1, "PROVEEDORID");
            AnyError = 1;
            GX_FocusControl = edtProveedorId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         }
         GxWebStd.set_html_headers( context, 0, "", "");
         context.GX_webresponse.AddString("new Array( new Array(");
         context.GX_webresponse.AddString("");
         context.GX_webresponse.AddString(")");
         if ( (pr_default.getStatus(16) == 101) )
         {
            context.GX_webresponse.AddString(",");
            context.GX_webresponse.AddString("101");
         }
         context.GX_webresponse.AddString(")");
         pr_default.close(16);
      }

      protected void GetKey049( )
      {
         /* Using cursor T000419 */
         pr_default.execute(17, new Object[] {A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
         if ( (pr_default.getStatus(17) != 101) )
         {
            RcdFound9 = 1;
         }
         else
         {
            RcdFound9 = 0;
         }
         pr_default.close(17);
      }

      protected void getByPrimaryKey049( )
      {
         /* Using cursor T00043 */
         pr_default.execute(1, new Object[] {A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
         if ( (pr_default.getStatus(1) != 101) )
         {
            ZM049( 3) ;
            RcdFound9 = 1;
            InitializeNonKey049( ) ;
            A34IngredientePrecioFechaVigencia = T00043_A34IngredientePrecioFechaVigencia[0];
            A35IngredientePrecioImporte = T00043_A35IngredientePrecioImporte[0];
            A36IngredientePrecioEstado = T00043_A36IngredientePrecioEstado[0];
            A32ProveedorId = T00043_A32ProveedorId[0];
            Z24IngredienteId = A24IngredienteId;
            Z32ProveedorId = A32ProveedorId;
            Z34IngredientePrecioFechaVigencia = A34IngredientePrecioFechaVigencia;
            sMode9 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal049( ) ;
            Load049( ) ;
            Gx_mode = sMode9;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         else
         {
            RcdFound9 = 0;
            InitializeNonKey049( ) ;
            sMode9 = Gx_mode;
            Gx_mode = "DSP";
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
            standaloneModal049( ) ;
            Gx_mode = sMode9;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         }
         if ( ( StringUtil.StrCmp(Gx_mode, "DSP") == 0 ) || ( StringUtil.StrCmp(Gx_mode, "DLT") == 0 ) )
         {
            DisableAttributes049( ) ;
         }
         pr_default.close(1);
      }

      protected void CheckOptimisticConcurrency049( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            /* Using cursor T00042 */
            pr_default.execute(0, new Object[] {A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
            if ( (pr_default.getStatus(0) == 103) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"IngredientePrecio"}), "RecordIsLocked", 1, "");
               AnyError = 1;
               return  ;
            }
            if ( (pr_default.getStatus(0) == 101) || ( Z35IngredientePrecioImporte != T00042_A35IngredientePrecioImporte[0] ) || ( StringUtil.StrCmp(Z36IngredientePrecioEstado, T00042_A36IngredientePrecioEstado[0]) != 0 ) )
            {
               GX_msglist.addItem(context.GetMessage( "GXM_waschg", new   object[]  {"IngredientePrecio"}), "RecordWasChanged", 1, "");
               AnyError = 1;
               return  ;
            }
         }
      }

      protected void Insert049( )
      {
         BeforeValidate049( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable049( ) ;
         }
         if ( AnyError == 0 )
         {
            ZM049( 0) ;
            CheckOptimisticConcurrency049( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm049( ) ;
               if ( AnyError == 0 )
               {
                  BeforeInsert049( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000420 */
                     pr_default.execute(18, new Object[] {A24IngredienteId, A34IngredientePrecioFechaVigencia, A35IngredientePrecioImporte, A36IngredientePrecioEstado, A32ProveedorId});
                     pr_default.close(18);
                     dsDefault.SmartCacheProvider.SetUpdated("IngredientePrecio") ;
                     if ( (pr_default.getStatus(18) == 1) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_noupdate", ""), "DuplicatePrimaryKey", 1, "");
                        AnyError = 1;
                     }
                     if ( AnyError == 0 )
                     {
                        /* Start of After( Insert) rules */
                        /* End of After( Insert) rules */
                        if ( AnyError == 0 )
                        {
                           /* Save values for previous() function. */
                        }
                     }
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
            else
            {
               Load049( ) ;
            }
            EndLevel049( ) ;
         }
         CloseExtendedTableCursors049( ) ;
      }

      protected void Update049( )
      {
         BeforeValidate049( ) ;
         if ( AnyError == 0 )
         {
            CheckExtendedTable049( ) ;
         }
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency049( ) ;
            if ( AnyError == 0 )
            {
               AfterConfirm049( ) ;
               if ( AnyError == 0 )
               {
                  BeforeUpdate049( ) ;
                  if ( AnyError == 0 )
                  {
                     /* Using cursor T000421 */
                     pr_default.execute(19, new Object[] {A35IngredientePrecioImporte, A36IngredientePrecioEstado, A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
                     pr_default.close(19);
                     dsDefault.SmartCacheProvider.SetUpdated("IngredientePrecio") ;
                     if ( (pr_default.getStatus(19) == 103) )
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_lock", new   object[]  {"IngredientePrecio"}), "RecordIsLocked", 1, "");
                        AnyError = 1;
                     }
                     DeferredUpdate049( ) ;
                     if ( AnyError == 0 )
                     {
                        /* Start of After( update) rules */
                        /* End of After( update) rules */
                        if ( AnyError == 0 )
                        {
                           getByPrimaryKey049( ) ;
                        }
                     }
                     else
                     {
                        GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                        AnyError = 1;
                     }
                  }
               }
            }
            EndLevel049( ) ;
         }
         CloseExtendedTableCursors049( ) ;
      }

      protected void DeferredUpdate049( )
      {
      }

      protected void Delete049( )
      {
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         BeforeValidate049( ) ;
         if ( AnyError == 0 )
         {
            CheckOptimisticConcurrency049( ) ;
         }
         if ( AnyError == 0 )
         {
            OnDeleteControls049( ) ;
            AfterConfirm049( ) ;
            if ( AnyError == 0 )
            {
               BeforeDelete049( ) ;
               if ( AnyError == 0 )
               {
                  /* No cascading delete specified. */
                  /* Using cursor T000422 */
                  pr_default.execute(20, new Object[] {A24IngredienteId, A32ProveedorId, A34IngredientePrecioFechaVigencia});
                  pr_default.close(20);
                  dsDefault.SmartCacheProvider.SetUpdated("IngredientePrecio") ;
                  if ( AnyError == 0 )
                  {
                     /* Start of After( delete) rules */
                     /* End of After( delete) rules */
                  }
                  else
                  {
                     GX_msglist.addItem(context.GetMessage( "GXM_unexp", ""), 1, "");
                     AnyError = 1;
                  }
               }
            }
         }
         sMode9 = Gx_mode;
         Gx_mode = "DLT";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         EndLevel049( ) ;
         Gx_mode = sMode9;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
      }

      protected void OnDeleteControls049( )
      {
         standaloneModal049( ) ;
         /* No delete mode formulas found. */
      }

      protected void EndLevel049( )
      {
         if ( StringUtil.StrCmp(Gx_mode, "INS") != 0 )
         {
            pr_default.close(0);
         }
         if ( AnyError != 0 )
         {
            context.wjLoc = "";
            context.nUserReturn = 0;
         }
      }

      public void ScanStart049( )
      {
         /* Scan By routine */
         /* Using cursor T000423 */
         pr_default.execute(21, new Object[] {A24IngredienteId});
         RcdFound9 = 0;
         if ( (pr_default.getStatus(21) != 101) )
         {
            RcdFound9 = 1;
            A32ProveedorId = T000423_A32ProveedorId[0];
            A34IngredientePrecioFechaVigencia = T000423_A34IngredientePrecioFechaVigencia[0];
         }
         /* Load Subordinate Levels */
      }

      protected void ScanNext049( )
      {
         /* Scan next routine */
         pr_default.readNext(21);
         RcdFound9 = 0;
         if ( (pr_default.getStatus(21) != 101) )
         {
            RcdFound9 = 1;
            A32ProveedorId = T000423_A32ProveedorId[0];
            A34IngredientePrecioFechaVigencia = T000423_A34IngredientePrecioFechaVigencia[0];
         }
      }

      protected void ScanEnd049( )
      {
         pr_default.close(1);
      }

      protected void AfterConfirm049( )
      {
         /* After Confirm Rules */
      }

      protected void BeforeInsert049( )
      {
         /* Before Insert Rules */
      }

      protected void BeforeUpdate049( )
      {
         /* Before Update Rules */
      }

      protected void BeforeDelete049( )
      {
         /* Before Delete Rules */
      }

      protected void BeforeComplete049( )
      {
         /* Before Complete Rules */
      }

      protected void BeforeValidate049( )
      {
         /* Before Validate Rules */
      }

      protected void DisableAttributes049( )
      {
         edtProveedorId_Enabled = 0;
         edtIngredientePrecioFechaVigencia_Enabled = 0;
         edtIngredientePrecioImporte_Enabled = 0;
         edtIngredientePrecioEstado_Enabled = 0;
      }

      protected void AddRow049( )
      {
         nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
         imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
         edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
         edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
         edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
         SendRow049( ) ;
      }

      protected void SendRow049( )
      {
         Gridingrediente_precioRow = GXWebRow.GetNew(context);
         if ( subGridingrediente_precio_Backcolorstyle == 0 )
         {
            /* None style subfile background logic. */
            subGridingrediente_precio_Backstyle = 0;
            if ( StringUtil.StrCmp(subGridingrediente_precio_Class, "") != 0 )
            {
               subGridingrediente_precio_Linesclass = subGridingrediente_precio_Class+"Odd";
            }
         }
         else if ( subGridingrediente_precio_Backcolorstyle == 1 )
         {
            /* Uniform style subfile background logic. */
            subGridingrediente_precio_Backstyle = 0;
            subGridingrediente_precio_Backcolor = subGridingrediente_precio_Allbackcolor;
            if ( StringUtil.StrCmp(subGridingrediente_precio_Class, "") != 0 )
            {
               subGridingrediente_precio_Linesclass = subGridingrediente_precio_Class+"Uniform";
            }
         }
         else if ( subGridingrediente_precio_Backcolorstyle == 2 )
         {
            /* Header style subfile background logic. */
            subGridingrediente_precio_Backstyle = 1;
            if ( StringUtil.StrCmp(subGridingrediente_precio_Class, "") != 0 )
            {
               subGridingrediente_precio_Linesclass = subGridingrediente_precio_Class+"Odd";
            }
            subGridingrediente_precio_Backcolor = (int)(0xF0F0F0);
         }
         else if ( subGridingrediente_precio_Backcolorstyle == 3 )
         {
            /* Report style subfile background logic. */
            subGridingrediente_precio_Backstyle = 1;
            if ( (int)(nGXsfl_76_idx % (2)) == 0 )
            {
               subGridingrediente_precio_Backcolor = (int)(0x0);
               if ( StringUtil.StrCmp(subGridingrediente_precio_Class, "") != 0 )
               {
                  subGridingrediente_precio_Linesclass = subGridingrediente_precio_Class+"Even";
               }
            }
            else
            {
               subGridingrediente_precio_Backcolor = (int)(0xF0F0F0);
               if ( StringUtil.StrCmp(subGridingrediente_precio_Class, "") != 0 )
               {
                  subGridingrediente_precio_Linesclass = subGridingrediente_precio_Class+"Odd";
               }
            }
         }
         imgprompt_32_Link = ((StringUtil.StrCmp(Gx_mode, "DSP")==0)||(StringUtil.StrCmp(Gx_mode, "UPD")==0) ? "" : "javascript:"+"gx.popup.openPrompt('"+"gx0080.aspx"+"',["+"{Ctrl:gx.dom.el('"+"PROVEEDORID_"+sGXsfl_76_idx+"'), id:'"+"PROVEEDORID_"+sGXsfl_76_idx+"'"+",IOType:'out'}"+"],"+"gx.dom.form()."+"nIsMod_9_"+sGXsfl_76_idx+","+"'', false"+","+"false"+");");
         /* * Property Link not supported in */
         /* * Property Link not supported in */
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_9_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 77,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridingrediente_precioRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtProveedorId_Internalname,StringUtil.LTrim( StringUtil.NToC( (decimal)(A32ProveedorId), 10, 0, ",", "")),StringUtil.LTrim( context.localUtil.Format( (decimal)(A32ProveedorId), "ZZZZZZZZZ9")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_integer( this,'.');"+";gx.evt.onblur(77);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtProveedorId_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtProveedorId_Enabled,(short)1,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)10,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Id",(String)"right"});
         /* Subfile cell */
         /* Static images/pictures */
         ClassString = "Image";
         StyleString = "";
         Gridingrediente_precioRow.AddColumnProperties("bitmap", 1, isAjaxCallMode( ), new Object[] {(String)imgprompt_32_Internalname,context.GetImagePath( "f5b04895-0024-488b-8e3b-b687ca4598ee", "", context.GetTheme( )),(String)imgprompt_32_Link,(String)"",(String)"",context.GetTheme( ),(int)imgprompt_32_Visible,(short)1,(String)"",(String)"",(short)0,(short)0,(short)0,(String)"",(short)0,(String)"",(short)0,(short)0,(short)0,(String)"",(String)"",(String)StyleString,(String)ClassString,(String)"",(String)"",(String)"",(String)"''",(String)"",(short)1,(bool)false,(bool)false});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_9_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 78,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridingrediente_precioRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtIngredientePrecioFechaVigencia_Internalname,context.localUtil.Format(A34IngredientePrecioFechaVigencia, "99/99/99"),context.localUtil.Format( A34IngredientePrecioFechaVigencia, "99/99/99"),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.date.valid_date(this, 8,'DMY',0,24,'spa',false,0);"+";gx.evt.onblur(78);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtIngredientePrecioFechaVigencia_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtIngredientePrecioFechaVigencia_Enabled,(short)1,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)8,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_9_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 79,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridingrediente_precioRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtIngredientePrecioImporte_Internalname,StringUtil.LTrim( StringUtil.NToC( A35IngredientePrecioImporte, 5, 2, ",", "")),((edtIngredientePrecioImporte_Enabled!=0) ? StringUtil.LTrim( context.localUtil.Format( A35IngredientePrecioImporte, "Z9.99")) : context.localUtil.Format( A35IngredientePrecioImporte, "Z9.99")),TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+"gx.num.valid_decimal( this, '.',',','2');"+";gx.evt.onblur(79);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtIngredientePrecioImporte_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtIngredientePrecioImporte_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)5,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)0,(bool)true,(String)"Importe",(String)"right"});
         /* Subfile cell */
         /* Single line edit */
         TempTags = " gxoch1=\"gx.fn.setControlValue('nIsMod_9_" + sGXsfl_76_idx + "',1);\"  onfocus=\"gx.evt.onfocus(this, 80,'',false,'" + sGXsfl_76_idx + "',76)\"";
         ClassString = "Attribute";
         StyleString = "";
         ROClassString = ClassString;
         Gridingrediente_precioRow.AddColumnProperties("edit", 1, isAjaxCallMode( ), new Object[] {(String)edtIngredientePrecioEstado_Internalname,StringUtil.RTrim( A36IngredientePrecioEstado),(String)"",TempTags+" onchange=\"gx.evt.onchange(this)\" "+" onblur=\""+""+";gx.evt.onblur(80);\"",(String)"",(String)"",(String)"",(String)"",(String)"",(String)edtIngredientePrecioEstado_Jsonclick,(short)0,(String)ClassString,(String)StyleString,(String)ROClassString,(short)-1,(int)edtIngredientePrecioEstado_Enabled,(short)0,(String)"text",(String)"",(short)0,(String)"px",(short)17,(String)"px",(short)1,(short)0,(short)0,(short)76,(short)1,(short)-1,(short)-1,(bool)true,(String)"Estado",(String)"left"});
         context.httpAjaxContext.ajax_sending_grid_row(Gridingrediente_precioRow);
         GXCCtl = "Z32ProveedorId_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(Z32ProveedorId), 10, 0, ",", "")));
         GXCCtl = "Z34IngredientePrecioFechaVigencia_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, context.localUtil.DToC( Z34IngredientePrecioFechaVigencia, 0, "/"));
         GXCCtl = "Z35IngredientePrecioImporte_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( Z35IngredientePrecioImporte, 5, 2, ",", "")));
         GXCCtl = "Z36IngredientePrecioEstado_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.RTrim( Z36IngredientePrecioEstado));
         GXCCtl = "nRcdDeleted_9_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdDeleted_9), 4, 0, ",", "")));
         GXCCtl = "nRcdExists_9_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nRcdExists_9), 4, 0, ",", "")));
         GXCCtl = "nIsMod_9_" + sGXsfl_76_idx;
         GxWebStd.gx_hidden_field( context, GXCCtl, StringUtil.LTrim( StringUtil.NToC( (decimal)(nIsMod_9), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "PROVEEDORID_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtProveedorId_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioFechaVigencia_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioImporte_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx+"Enabled", StringUtil.LTrim( StringUtil.NToC( (decimal)(edtIngredientePrecioEstado_Enabled), 5, 0, ".", "")));
         GxWebStd.gx_hidden_field( context, "PROMPT_32_"+sGXsfl_76_idx+"Link", StringUtil.RTrim( imgprompt_32_Link));
         context.httpAjaxContext.ajax_sending_grid_row(null);
         Gridingrediente_precioContainer.AddRow(Gridingrediente_precioRow);
      }

      protected void ReadRow049( )
      {
         nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
         imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
         edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
         edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
         edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
         edtProveedorId_Enabled = (int)(context.localUtil.CToN( cgiGet( "PROVEEDORID_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtIngredientePrecioFechaVigencia_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtIngredientePrecioImporte_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         edtIngredientePrecioEstado_Enabled = (int)(context.localUtil.CToN( cgiGet( "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx+"Enabled"), ",", "."));
         imgprompt_32_Link = cgiGet( "PROMPT_32_"+sGXsfl_76_idx+"Link");
         if ( ( ( context.localUtil.CToN( cgiGet( edtProveedorId_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtProveedorId_Internalname), ",", ".") > Convert.ToDecimal( 9999999999L )) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "PROVEEDORID");
            AnyError = 1;
            GX_FocusControl = edtProveedorId_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A32ProveedorId = 0;
         }
         else
         {
            A32ProveedorId = (long)(context.localUtil.CToN( cgiGet( edtProveedorId_Internalname), ",", "."));
         }
         if ( context.localUtil.VCDate( cgiGet( edtIngredientePrecioFechaVigencia_Internalname), 2) == 0 )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_faildate", new   object[]  {"Ingrediente Precio Fecha Vigencia"}), 1, "INGREDIENTEPRECIOFECHAVIGENCIA");
            AnyError = 1;
            GX_FocusControl = edtIngredientePrecioFechaVigencia_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A34IngredientePrecioFechaVigencia = DateTime.MinValue;
         }
         else
         {
            A34IngredientePrecioFechaVigencia = context.localUtil.CToD( cgiGet( edtIngredientePrecioFechaVigencia_Internalname), 2);
         }
         if ( ( ( context.localUtil.CToN( cgiGet( edtIngredientePrecioImporte_Internalname), ",", ".") < Convert.ToDecimal( 0 )) ) || ( ( context.localUtil.CToN( cgiGet( edtIngredientePrecioImporte_Internalname), ",", ".") > 99.99m ) ) )
         {
            GX_msglist.addItem(context.GetMessage( "GXM_badnum", ""), 1, "INGREDIENTEPRECIOIMPORTE");
            AnyError = 1;
            GX_FocusControl = edtIngredientePrecioImporte_Internalname;
            context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
            wbErr = true;
            A35IngredientePrecioImporte = 0;
         }
         else
         {
            A35IngredientePrecioImporte = context.localUtil.CToN( cgiGet( edtIngredientePrecioImporte_Internalname), ",", ".");
         }
         A36IngredientePrecioEstado = cgiGet( edtIngredientePrecioEstado_Internalname);
         GXCCtl = "Z32ProveedorId_" + sGXsfl_76_idx;
         Z32ProveedorId = (long)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "Z34IngredientePrecioFechaVigencia_" + sGXsfl_76_idx;
         Z34IngredientePrecioFechaVigencia = context.localUtil.CToD( cgiGet( GXCCtl), 0);
         GXCCtl = "Z35IngredientePrecioImporte_" + sGXsfl_76_idx;
         Z35IngredientePrecioImporte = context.localUtil.CToN( cgiGet( GXCCtl), ",", ".");
         GXCCtl = "Z36IngredientePrecioEstado_" + sGXsfl_76_idx;
         Z36IngredientePrecioEstado = cgiGet( GXCCtl);
         GXCCtl = "nRcdDeleted_9_" + sGXsfl_76_idx;
         nRcdDeleted_9 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nRcdExists_9_" + sGXsfl_76_idx;
         nRcdExists_9 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
         GXCCtl = "nIsMod_9_" + sGXsfl_76_idx;
         nIsMod_9 = (short)(context.localUtil.CToN( cgiGet( GXCCtl), ",", "."));
      }

      protected void assign_properties_default( )
      {
         defedtIngredientePrecioFechaVigencia_Enabled = edtIngredientePrecioFechaVigencia_Enabled;
         defedtProveedorId_Enabled = edtProveedorId_Enabled;
      }

      protected void ConfirmValues040( )
      {
         nGXsfl_76_idx = 0;
         sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
         edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
         imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
         edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
         edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
         edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
         while ( nGXsfl_76_idx < nRC_Gridingrediente_precio )
         {
            nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
            sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
            edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
            imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
            edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
            edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
            edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
            ChangePostValue( "Z32ProveedorId_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z32ProveedorId_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z32ProveedorId_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z34IngredientePrecioFechaVigencia_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z34IngredientePrecioFechaVigencia_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z34IngredientePrecioFechaVigencia_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z35IngredientePrecioImporte_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z35IngredientePrecioImporte_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z35IngredientePrecioImporte_"+sGXsfl_76_idx) ;
            ChangePostValue( "Z36IngredientePrecioEstado_"+sGXsfl_76_idx, cgiGet( "ZT_"+"Z36IngredientePrecioEstado_"+sGXsfl_76_idx)) ;
            DeletePostValue( "ZT_"+"Z36IngredientePrecioEstado_"+sGXsfl_76_idx) ;
         }
      }

      public override void RenderHtmlHeaders( )
      {
         GxWebStd.gx_html_headers( context, 0, "", "", Form.Meta, Form.Metaequiv, "IE=EmulateIE7");
      }

      public override void RenderHtmlOpenForm( )
      {
         context.WriteHtmlText( "<title>") ;
         context.SendWebValue( Form.Caption) ;
         context.WriteHtmlTextNl( "</title>") ;
         if ( StringUtil.Len( sDynURL) > 0 )
         {
            context.WriteHtmlText( "<BASE href=\""+sDynURL+"\" />") ;
         }
         define_styles( ) ;
         MasterPageObj.master_styles();
         if ( ! context.isSmartDevice( ) )
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgral.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         else
         {
            context.AddJavascriptSource("gxtimezone.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxapiSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfxSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxhtmlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxtypesSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxpopupSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxfrmutlSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgridSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("JavaScripTableSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("rijndaelSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxgralSD.js", "?"+context.GetBuildNumber( 75733));
            context.AddJavascriptSource("gxcfg.js", "?"+context.GetBuildNumber( 75733));
         }
         context.AddJavascriptSource("calendar.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("calendar-setup.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("calendar-es.js", "?"+context.GetBuildNumber( 75733));
         context.WriteHtmlText( Form.Headerrawhtml) ;
         context.CloseHtmlHeader();
         FormProcess = " onkeyup=\"gx.evt.onkeyup(event)\" onkeypress=\"gx.evt.onkeypress(event,true,false)\" onkeydown=\"gx.evt.onkeypress(null,true,false)\"";
         context.WriteHtmlText( "<body") ;
         context.WriteHtmlText( " "+"class=\"Form\""+" "+" style=\"-moz-opacity:0;opacity:0;"+"background-color:"+context.BuildHTMLColor( Form.Backcolor)+";") ;
         if ( ! ( String.IsNullOrEmpty(StringUtil.RTrim( Form.Background)) ) )
         {
            context.WriteHtmlText( " background-image:url("+context.convertURL( Form.Background)+")") ;
         }
         context.WriteHtmlText( "\""+FormProcess+">") ;
         context.skipLines(1);
         context.WriteHtmlTextNl( "<form id=\"MAINFORM\" onsubmit=\"try{return gx.csv.validForm()}catch(e){return true;}\" name=\"MAINFORM\" method=\"post\" class=\"Form\" novalidate action=\""+formatLink("ingrediente.aspx") +"\">") ;
         GxWebStd.gx_hidden_field( context, "_EventName", "");
         GxWebStd.gx_hidden_field( context, "_EventGridId", "");
         GxWebStd.gx_hidden_field( context, "_EventRowId", "");
      }

      public override void RenderHtmlCloseForm( )
      {
         /* Send hidden variables. */
         /* Send saved values. */
         GxWebStd.gx_hidden_field( context, "Z24IngredienteId", StringUtil.LTrim( StringUtil.NToC( (decimal)(Z24IngredienteId), 10, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z27IngredienteDescripcion", StringUtil.RTrim( Z27IngredienteDescripcion));
         GxWebStd.gx_hidden_field( context, "Z26IngredienteCosto", StringUtil.LTrim( StringUtil.NToC( Z26IngredienteCosto, 5, 2, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z28IngredienteUnidadMedida", StringUtil.RTrim( Z28IngredienteUnidadMedida));
         GxWebStd.gx_hidden_field( context, "Z29IngredienteStock", StringUtil.LTrim( StringUtil.NToC( Z29IngredienteStock, 6, 3, ",", "")));
         GxWebStd.gx_hidden_field( context, "Z30IngredienteEstado", StringUtil.RTrim( Z30IngredienteEstado));
         GxWebStd.gx_hidden_field( context, "Z31IngredienteTipo", StringUtil.RTrim( Z31IngredienteTipo));
         GxWebStd.gx_hidden_field( context, "IsConfirmed", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsConfirmed), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "IsModified", StringUtil.LTrim( StringUtil.NToC( (decimal)(IsModified), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "Mode", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "nRC_Gridingrediente_precio", StringUtil.LTrim( StringUtil.NToC( (decimal)(nGXsfl_76_idx), 4, 0, ",", "")));
         GxWebStd.gx_hidden_field( context, "vMODE", StringUtil.RTrim( Gx_mode));
         GxWebStd.gx_hidden_field( context, "GX_FocusControl", GX_FocusControl);
         SendAjaxEncryptionKey();
         SendComponentObjects();
         SendServerCommands();
         SendState();
         context.WriteHtmlTextNl( "</form>") ;
         include_jscripts( ) ;
      }

      public override short ExecuteStartEvent( )
      {
         standaloneStartup( ) ;
         gxajaxcallmode = (short)((isAjaxCallMode( ) ? 1 : 0));
         return gxajaxcallmode ;
      }

      public override void RenderHtmlContent( )
      {
         Draw( ) ;
      }

      public override void DispatchEvents( )
      {
         Process( ) ;
      }

      public override bool HasEnterEvent( )
      {
         return true ;
      }

      public override String GetPgmname( )
      {
         return "Ingrediente" ;
      }

      public override String GetPgmdesc( )
      {
         return "Ingrediente" ;
      }

      public override GXWebForm GetForm( )
      {
         return Form ;
      }

      public override String GetSelfLink( )
      {
         return formatLink("ingrediente.aspx")  ;
      }

      protected void InitializeNonKey046( )
      {
         A27IngredienteDescripcion = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A27IngredienteDescripcion", A27IngredienteDescripcion);
         A26IngredienteCosto = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A26IngredienteCosto", StringUtil.LTrim( StringUtil.Str( A26IngredienteCosto, 5, 2)));
         A28IngredienteUnidadMedida = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A28IngredienteUnidadMedida", A28IngredienteUnidadMedida);
         A29IngredienteStock = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A29IngredienteStock", StringUtil.LTrim( StringUtil.Str( A29IngredienteStock, 6, 3)));
         A30IngredienteEstado = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A30IngredienteEstado", A30IngredienteEstado);
         A31IngredienteTipo = "";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A31IngredienteTipo", A31IngredienteTipo);
      }

      protected void InitAll046( )
      {
         A24IngredienteId = 0;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "A24IngredienteId", StringUtil.LTrim( StringUtil.Str( (decimal)(A24IngredienteId), 10, 0)));
         InitializeNonKey046( ) ;
      }

      protected void StandaloneModalInsert( )
      {
      }

      protected void InitializeNonKey049( )
      {
         A35IngredientePrecioImporte = 0;
         A36IngredientePrecioEstado = "";
      }

      protected void InitAll049( )
      {
         A32ProveedorId = 0;
         A34IngredientePrecioFechaVigencia = DateTime.MinValue;
         InitializeNonKey049( ) ;
      }

      protected void StandaloneModalInsert049( )
      {
      }

      protected void define_styles( )
      {
         AddStyleSheetFile("calendar-system.css", "?1316260");
         AddThemeStyleSheetFile("", context.GetTheme( )+".css", "?22151370");
         idxLst = 1;
         while ( idxLst <= Form.Jscriptsrc.Count )
         {
            context.AddJavascriptSource(StringUtil.RTrim( Form.Jscriptsrc.Item(idxLst)), "?20147172215256");
            idxLst = (int)(idxLst+1);
         }
         /* End function define_styles */
      }

      protected void include_jscripts( )
      {
         context.AddJavascriptSource("messages.spa.js", "?"+context.GetBuildNumber( 75733));
         context.AddJavascriptSource("ingrediente.js", "?20147172215257");
         /* End function include_jscripts */
      }

      protected void init_level_properties9( )
      {
         edtIngredientePrecioFechaVigencia_Enabled = defedtIngredientePrecioFechaVigencia_Enabled;
         edtProveedorId_Enabled = defedtProveedorId_Enabled;
      }

      protected void init_default_properties( )
      {
         imgBtn_first_Internalname = "BTN_FIRST";
         imgBtn_first_separator_Internalname = "BTN_FIRST_SEPARATOR";
         imgBtn_previous_Internalname = "BTN_PREVIOUS";
         imgBtn_previous_separator_Internalname = "BTN_PREVIOUS_SEPARATOR";
         imgBtn_next_Internalname = "BTN_NEXT";
         imgBtn_next_separator_Internalname = "BTN_NEXT_SEPARATOR";
         imgBtn_last_Internalname = "BTN_LAST";
         imgBtn_last_separator_Internalname = "BTN_LAST_SEPARATOR";
         imgBtn_select_Internalname = "BTN_SELECT";
         imgBtn_select_separator_Internalname = "BTN_SELECT_SEPARATOR";
         imgBtn_enter2_Internalname = "BTN_ENTER2";
         imgBtn_enter2_separator_Internalname = "BTN_ENTER2_SEPARATOR";
         imgBtn_cancel2_Internalname = "BTN_CANCEL2";
         imgBtn_cancel2_separator_Internalname = "BTN_CANCEL2_SEPARATOR";
         imgBtn_delete2_Internalname = "BTN_DELETE2";
         imgBtn_delete2_separator_Internalname = "BTN_DELETE2_SEPARATOR";
         divSectiontoolbar_Internalname = "SECTIONTOOLBAR";
         tblTabletoolbar_Internalname = "TABLETOOLBAR";
         lblTextblockingredienteid_Internalname = "TEXTBLOCKINGREDIENTEID";
         edtIngredienteId_Internalname = "INGREDIENTEID";
         lblTextblockingredientedescripcion_Internalname = "TEXTBLOCKINGREDIENTEDESCRIPCION";
         edtIngredienteDescripcion_Internalname = "INGREDIENTEDESCRIPCION";
         lblTextblockingredientecosto_Internalname = "TEXTBLOCKINGREDIENTECOSTO";
         edtIngredienteCosto_Internalname = "INGREDIENTECOSTO";
         lblTextblockingredienteunidadmedida_Internalname = "TEXTBLOCKINGREDIENTEUNIDADMEDIDA";
         edtIngredienteUnidadMedida_Internalname = "INGREDIENTEUNIDADMEDIDA";
         lblTextblockingredientestock_Internalname = "TEXTBLOCKINGREDIENTESTOCK";
         edtIngredienteStock_Internalname = "INGREDIENTESTOCK";
         lblTextblockingredienteestado_Internalname = "TEXTBLOCKINGREDIENTEESTADO";
         edtIngredienteEstado_Internalname = "INGREDIENTEESTADO";
         lblTextblockingredientetipo_Internalname = "TEXTBLOCKINGREDIENTETIPO";
         edtIngredienteTipo_Internalname = "INGREDIENTETIPO";
         lblTitleprecio_Internalname = "TITLEPRECIO";
         tblTable3_Internalname = "TABLE3";
         tblTable2_Internalname = "TABLE2";
         bttBtn_enter_Internalname = "BTN_ENTER";
         bttBtn_cancel_Internalname = "BTN_CANCEL";
         bttBtn_delete_Internalname = "BTN_DELETE";
         tblTable1_Internalname = "TABLE1";
         grpGroupdata_Internalname = "GROUPDATA";
         tblTablemain_Internalname = "TABLEMAIN";
         Form.Internalname = "FORM";
         subGridingrediente_precio_Internalname = "GRIDINGREDIENTE_PRECIO";
      }

      public override void initialize_properties( )
      {
         init_default_properties( ) ;
         Form.Headerrawhtml = "";
         Form.Background = "";
         Form.Backcolor = (int)(0xFFFFFF);
         Form.Caption = "Ingrediente";
         edtIngredientePrecioEstado_Jsonclick = "";
         edtIngredientePrecioImporte_Jsonclick = "";
         edtIngredientePrecioFechaVigencia_Jsonclick = "";
         imgprompt_32_Visible = 1;
         imgprompt_32_Link = "";
         imgprompt_32_Visible = 1;
         edtProveedorId_Jsonclick = "";
         subGridingrediente_precio_Class = "Grid";
         imgBtn_delete2_separator_Visible = 1;
         imgBtn_delete2_Enabled = 1;
         imgBtn_delete2_Visible = 1;
         imgBtn_cancel2_separator_Visible = 1;
         imgBtn_cancel2_Visible = 1;
         imgBtn_enter2_separator_Visible = 1;
         imgBtn_enter2_Enabled = 1;
         imgBtn_enter2_Visible = 1;
         imgBtn_select_separator_Visible = 1;
         imgBtn_select_Visible = 1;
         imgBtn_last_separator_Visible = 1;
         imgBtn_last_Visible = 1;
         imgBtn_next_separator_Visible = 1;
         imgBtn_next_Visible = 1;
         imgBtn_previous_separator_Visible = 1;
         imgBtn_previous_Visible = 1;
         imgBtn_first_separator_Visible = 1;
         imgBtn_first_Visible = 1;
         subGridingrediente_precio_Allowcollapsing = 0;
         subGridingrediente_precio_Allowselection = 0;
         edtIngredientePrecioEstado_Enabled = 1;
         edtIngredientePrecioImporte_Enabled = 1;
         edtIngredientePrecioFechaVigencia_Enabled = 1;
         edtProveedorId_Enabled = 1;
         subGridingrediente_precio_Backcolorstyle = 2;
         edtIngredienteTipo_Jsonclick = "";
         edtIngredienteTipo_Enabled = 1;
         edtIngredienteEstado_Jsonclick = "";
         edtIngredienteEstado_Enabled = 1;
         edtIngredienteStock_Jsonclick = "";
         edtIngredienteStock_Enabled = 1;
         edtIngredienteUnidadMedida_Jsonclick = "";
         edtIngredienteUnidadMedida_Enabled = 1;
         edtIngredienteCosto_Jsonclick = "";
         edtIngredienteCosto_Enabled = 1;
         edtIngredienteDescripcion_Enabled = 1;
         edtIngredienteId_Jsonclick = "";
         edtIngredienteId_Enabled = 1;
         bttBtn_delete_Visible = 1;
         bttBtn_cancel_Visible = 1;
         bttBtn_enter_Visible = 1;
         context.GX_msglist.DisplayMode = 1;
      }

      protected void dynload_actions( )
      {
         /* End function dynload_actions */
      }

      protected void gxnrGridingrediente_precio_newrow( short nRC_Gridingrediente_precio ,
                                                        short nGXsfl_76_idx ,
                                                        String sGXsfl_76_idx )
      {
         GxWebStd.set_html_headers( context, 0, "", "");
         Gx_mode = "INS";
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "Gx_mode", Gx_mode);
         edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
         imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
         edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
         edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
         edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
         while ( nGXsfl_76_idx <= nRC_Gridingrediente_precio )
         {
            standaloneNotModal( ) ;
            standaloneModal( ) ;
            standaloneNotModal049( ) ;
            standaloneModal049( ) ;
            dynload_actions( ) ;
            SendRow049( ) ;
            nGXsfl_76_idx = (short)(nGXsfl_76_idx+1);
            sGXsfl_76_idx = StringUtil.PadL( StringUtil.LTrim( StringUtil.Str( (decimal)(nGXsfl_76_idx), 4, 0)), 4, "0");
            edtProveedorId_Internalname = "PROVEEDORID_"+sGXsfl_76_idx;
            imgprompt_32_Internalname = "PROMPT_32_"+sGXsfl_76_idx;
            edtIngredientePrecioFechaVigencia_Internalname = "INGREDIENTEPRECIOFECHAVIGENCIA_"+sGXsfl_76_idx;
            edtIngredientePrecioImporte_Internalname = "INGREDIENTEPRECIOIMPORTE_"+sGXsfl_76_idx;
            edtIngredientePrecioEstado_Internalname = "INGREDIENTEPRECIOESTADO_"+sGXsfl_76_idx;
         }
         context.GX_webresponse.AddString(Gridingrediente_precioContainer.ToJavascriptSource());
         /* End function gxnrGridingrediente_precio_newrow */
      }

      protected void AfterKeyLoadScreen( )
      {
         IsConfirmed = 0;
         getEqualNoModal( ) ;
         GX_FocusControl = edtIngredienteDescripcion_Internalname;
         context.httpAjaxContext.ajax_rsp_assign_attri("", false, "GX_FocusControl", GX_FocusControl);
         standaloneNotModal( ) ;
         standaloneModal( ) ;
         /* End function AfterKeyLoadScreen */
      }

      public void Valid_Ingredienteid( long GX_Parm1 ,
                                       String GX_Parm2 ,
                                       decimal GX_Parm3 ,
                                       String GX_Parm4 ,
                                       decimal GX_Parm5 ,
                                       String GX_Parm6 ,
                                       String GX_Parm7 )
      {
         A24IngredienteId = GX_Parm1;
         A27IngredienteDescripcion = GX_Parm2;
         A26IngredienteCosto = GX_Parm3;
         A28IngredienteUnidadMedida = GX_Parm4;
         A29IngredienteStock = GX_Parm5;
         A30IngredienteEstado = GX_Parm6;
         A31IngredienteTipo = GX_Parm7;
         context.wbHandled = 1;
         AfterKeyLoadScreen( ) ;
         Draw( ) ;
         dynload_actions( ) ;
         if ( AnyError == 1 )
         {
         }
         isValidOutput.Add((Object)(StringUtil.RTrim( A27IngredienteDescripcion)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A26IngredienteCosto, 5, 2, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( A28IngredienteUnidadMedida)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( A29IngredienteStock, 6, 3, ".", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( A30IngredienteEstado)));
         isValidOutput.Add((Object)(StringUtil.RTrim( A31IngredienteTipo)));
         isValidOutput.Add((Object)(StringUtil.RTrim( Gx_mode)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( (decimal)(Z24IngredienteId), 10, 0, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z27IngredienteDescripcion)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( Z26IngredienteCosto, 5, 2, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z28IngredienteUnidadMedida)));
         isValidOutput.Add((Object)(StringUtil.LTrim( StringUtil.NToC( Z29IngredienteStock, 6, 3, ",", ""))));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z30IngredienteEstado)));
         isValidOutput.Add((Object)(StringUtil.RTrim( Z31IngredienteTipo)));
         isValidOutput.Add((Object)(Gridingrediente_precioContainer));
         isValidOutput.Add((Object)(imgBtn_delete2_Enabled));
         isValidOutput.Add((Object)(imgBtn_enter2_Enabled));
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void Valid_Proveedorid( long GX_Parm1 )
      {
         A32ProveedorId = GX_Parm1;
         /* Using cursor T000424 */
         pr_default.execute(22, new Object[] {A32ProveedorId});
         if ( (pr_default.getStatus(22) == 101) )
         {
            GX_msglist.addItem("No existe 'Proveedor'.", "ForeignKeyNotFound", 1, "PROVEEDORID");
            AnyError = 1;
            GX_FocusControl = edtProveedorId_Internalname;
         }
         pr_default.close(22);
         dynload_actions( ) ;
         isValidOutput.Add((Object)(context.GX_msglist.ToJavascriptSource()));
         context.GX_webresponse.AddString(isValidOutput.ToJSonString());
         wbTemp = context.ResponseContentType( "application/json");
      }

      public void cleanup( )
      {
         flushBuffer();
         CloseOpenCursors();
         if ( IsMain )
         {
            context.CloseConnections() ;
         }
      }

      protected void CloseOpenCursors( )
      {
         pr_default.close(21);
         pr_default.close(22);
         pr_default.close(14);
         pr_default.close(8);
         pr_default.close(7);
      }

      public override void initialize( )
      {
         sPrefix = "";
         scmdbuf = "";
         gxfirstwebparm = "";
         gxfirstwebparm_bkp = "";
         GXKey = "";
         PreviousTooltip = "";
         PreviousCaption = "";
         Form = new GXWebForm();
         GX_FocusControl = "";
         sStyleString = "";
         ClassString = "";
         StyleString = "";
         TempTags = "";
         bttBtn_enter_Jsonclick = "";
         bttBtn_cancel_Jsonclick = "";
         bttBtn_delete_Jsonclick = "";
         lblTextblockingredienteid_Jsonclick = "";
         lblTextblockingredientedescripcion_Jsonclick = "";
         A27IngredienteDescripcion = "";
         lblTextblockingredientecosto_Jsonclick = "";
         lblTextblockingredienteunidadmedida_Jsonclick = "";
         A28IngredienteUnidadMedida = "";
         lblTextblockingredientestock_Jsonclick = "";
         lblTextblockingredienteestado_Jsonclick = "";
         A30IngredienteEstado = "";
         lblTextblockingredientetipo_Jsonclick = "";
         A31IngredienteTipo = "";
         Gridingrediente_precioContainer = new GXWebGrid( context);
         Gridingrediente_precioColumn = new GXWebColumn();
         A34IngredientePrecioFechaVigencia = DateTime.MinValue;
         A36IngredientePrecioEstado = "";
         Gx_mode = "";
         sMode9 = "";
         edtProveedorId_Internalname = "";
         lblTitleprecio_Jsonclick = "";
         imgBtn_first_Jsonclick = "";
         imgBtn_first_separator_Jsonclick = "";
         imgBtn_previous_Jsonclick = "";
         imgBtn_previous_separator_Jsonclick = "";
         imgBtn_next_Jsonclick = "";
         imgBtn_next_separator_Jsonclick = "";
         imgBtn_last_Jsonclick = "";
         imgBtn_last_separator_Jsonclick = "";
         imgBtn_select_Jsonclick = "";
         imgBtn_select_separator_Jsonclick = "";
         imgBtn_enter2_Jsonclick = "";
         imgBtn_enter2_separator_Jsonclick = "";
         imgBtn_cancel2_Jsonclick = "";
         imgBtn_cancel2_separator_Jsonclick = "";
         imgBtn_delete2_Jsonclick = "";
         imgBtn_delete2_separator_Jsonclick = "";
         Z27IngredienteDescripcion = "";
         Z28IngredienteUnidadMedida = "";
         Z30IngredienteEstado = "";
         Z31IngredienteTipo = "";
         sEvt = "";
         EvtGridId = "";
         EvtRowId = "";
         sEvtType = "";
         edtIngredientePrecioFechaVigencia_Internalname = "";
         edtIngredientePrecioImporte_Internalname = "";
         edtIngredientePrecioEstado_Internalname = "";
         Z34IngredientePrecioFechaVigencia = DateTime.MinValue;
         Z36IngredientePrecioEstado = "";
         T00047_A24IngredienteId = new long[1] ;
         T00047_A27IngredienteDescripcion = new String[] {""} ;
         T00047_A26IngredienteCosto = new decimal[1] ;
         T00047_A28IngredienteUnidadMedida = new String[] {""} ;
         T00047_A29IngredienteStock = new decimal[1] ;
         T00047_A30IngredienteEstado = new String[] {""} ;
         T00047_A31IngredienteTipo = new String[] {""} ;
         T00048_A24IngredienteId = new long[1] ;
         T00046_A24IngredienteId = new long[1] ;
         T00046_A27IngredienteDescripcion = new String[] {""} ;
         T00046_A26IngredienteCosto = new decimal[1] ;
         T00046_A28IngredienteUnidadMedida = new String[] {""} ;
         T00046_A29IngredienteStock = new decimal[1] ;
         T00046_A30IngredienteEstado = new String[] {""} ;
         T00046_A31IngredienteTipo = new String[] {""} ;
         sMode6 = "";
         T00049_A24IngredienteId = new long[1] ;
         T000410_A24IngredienteId = new long[1] ;
         T000411_A24IngredienteId = new long[1] ;
         T000411_A27IngredienteDescripcion = new String[] {""} ;
         T000411_A26IngredienteCosto = new decimal[1] ;
         T000411_A28IngredienteUnidadMedida = new String[] {""} ;
         T000411_A29IngredienteStock = new decimal[1] ;
         T000411_A30IngredienteEstado = new String[] {""} ;
         T000411_A31IngredienteTipo = new String[] {""} ;
         T000415_A16ProductoId = new long[1] ;
         T000415_A24IngredienteId = new long[1] ;
         T000416_A24IngredienteId = new long[1] ;
         T000417_A24IngredienteId = new long[1] ;
         T000417_A34IngredientePrecioFechaVigencia = new DateTime[] {DateTime.MinValue} ;
         T000417_A35IngredientePrecioImporte = new decimal[1] ;
         T000417_A36IngredientePrecioEstado = new String[] {""} ;
         T000417_A32ProveedorId = new long[1] ;
         T00044_A32ProveedorId = new long[1] ;
         T000418_A32ProveedorId = new long[1] ;
         T000419_A24IngredienteId = new long[1] ;
         T000419_A32ProveedorId = new long[1] ;
         T000419_A34IngredientePrecioFechaVigencia = new DateTime[] {DateTime.MinValue} ;
         T00043_A24IngredienteId = new long[1] ;
         T00043_A34IngredientePrecioFechaVigencia = new DateTime[] {DateTime.MinValue} ;
         T00043_A35IngredientePrecioImporte = new decimal[1] ;
         T00043_A36IngredientePrecioEstado = new String[] {""} ;
         T00043_A32ProveedorId = new long[1] ;
         T00042_A24IngredienteId = new long[1] ;
         T00042_A34IngredientePrecioFechaVigencia = new DateTime[] {DateTime.MinValue} ;
         T00042_A35IngredientePrecioImporte = new decimal[1] ;
         T00042_A36IngredientePrecioEstado = new String[] {""} ;
         T00042_A32ProveedorId = new long[1] ;
         T000423_A24IngredienteId = new long[1] ;
         T000423_A32ProveedorId = new long[1] ;
         T000423_A34IngredientePrecioFechaVigencia = new DateTime[] {DateTime.MinValue} ;
         imgprompt_32_Internalname = "";
         Gridingrediente_precioRow = new GXWebRow();
         subGridingrediente_precio_Linesclass = "";
         ROClassString = "";
         GXCCtl = "";
         sDynURL = "";
         FormProcess = "";
         isValidOutput = new GxUnknownObjectCollection();
         T000424_A32ProveedorId = new long[1] ;
         pr_default = new DataStoreProvider(context, new GeneXus.Programs.ingrediente__default(),
            new Object[][] {
                new Object[] {
               T00042_A24IngredienteId, T00042_A34IngredientePrecioFechaVigencia, T00042_A35IngredientePrecioImporte, T00042_A36IngredientePrecioEstado, T00042_A32ProveedorId
               }
               , new Object[] {
               T00043_A24IngredienteId, T00043_A34IngredientePrecioFechaVigencia, T00043_A35IngredientePrecioImporte, T00043_A36IngredientePrecioEstado, T00043_A32ProveedorId
               }
               , new Object[] {
               T00044_A32ProveedorId
               }
               , new Object[] {
               T00045_A24IngredienteId, T00045_A27IngredienteDescripcion, T00045_A26IngredienteCosto, T00045_A28IngredienteUnidadMedida, T00045_A29IngredienteStock, T00045_A30IngredienteEstado, T00045_A31IngredienteTipo
               }
               , new Object[] {
               T00046_A24IngredienteId, T00046_A27IngredienteDescripcion, T00046_A26IngredienteCosto, T00046_A28IngredienteUnidadMedida, T00046_A29IngredienteStock, T00046_A30IngredienteEstado, T00046_A31IngredienteTipo
               }
               , new Object[] {
               T00047_A24IngredienteId, T00047_A27IngredienteDescripcion, T00047_A26IngredienteCosto, T00047_A28IngredienteUnidadMedida, T00047_A29IngredienteStock, T00047_A30IngredienteEstado, T00047_A31IngredienteTipo
               }
               , new Object[] {
               T00048_A24IngredienteId
               }
               , new Object[] {
               T00049_A24IngredienteId
               }
               , new Object[] {
               T000410_A24IngredienteId
               }
               , new Object[] {
               T000411_A24IngredienteId, T000411_A27IngredienteDescripcion, T000411_A26IngredienteCosto, T000411_A28IngredienteUnidadMedida, T000411_A29IngredienteStock, T000411_A30IngredienteEstado, T000411_A31IngredienteTipo
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000415_A16ProductoId, T000415_A24IngredienteId
               }
               , new Object[] {
               T000416_A24IngredienteId
               }
               , new Object[] {
               T000417_A24IngredienteId, T000417_A34IngredientePrecioFechaVigencia, T000417_A35IngredientePrecioImporte, T000417_A36IngredientePrecioEstado, T000417_A32ProveedorId
               }
               , new Object[] {
               T000418_A32ProveedorId
               }
               , new Object[] {
               T000419_A24IngredienteId, T000419_A32ProveedorId, T000419_A34IngredientePrecioFechaVigencia
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               }
               , new Object[] {
               T000423_A24IngredienteId, T000423_A32ProveedorId, T000423_A34IngredientePrecioFechaVigencia
               }
               , new Object[] {
               T000424_A32ProveedorId
               }
            }
         );
      }

      private short nIsMod_9 ;
      private short GxWebError ;
      private short nRC_Gridingrediente_precio ;
      private short nGXsfl_76_idx=1 ;
      private short gxcookieaux ;
      private short IsConfirmed ;
      private short IsModified ;
      private short AnyError ;
      private short nKeyPressed ;
      private short initialized ;
      private short subGridingrediente_precio_Backcolorstyle ;
      private short subGridingrediente_precio_Allowselection ;
      private short subGridingrediente_precio_Allowhovering ;
      private short subGridingrediente_precio_Allowcollapsing ;
      private short subGridingrediente_precio_Collapsed ;
      private short nBlankRcdCount9 ;
      private short nRcdExists_9 ;
      private short RcdFound9 ;
      private short nBlankRcdUsr9 ;
      private short nRcdDeleted_9 ;
      private short GX_JID ;
      private short RcdFound6 ;
      private short Gx_BScreen ;
      private short subGridingrediente_precio_Backstyle ;
      private short gxajaxcallmode ;
      private short wbTemp ;
      private int trnEnded ;
      private int bttBtn_enter_Visible ;
      private int bttBtn_cancel_Visible ;
      private int bttBtn_delete_Visible ;
      private int edtIngredienteId_Enabled ;
      private int edtIngredienteDescripcion_Enabled ;
      private int edtIngredienteCosto_Enabled ;
      private int edtIngredienteUnidadMedida_Enabled ;
      private int edtIngredienteStock_Enabled ;
      private int edtIngredienteEstado_Enabled ;
      private int edtIngredienteTipo_Enabled ;
      private int edtProveedorId_Enabled ;
      private int edtIngredientePrecioFechaVigencia_Enabled ;
      private int edtIngredientePrecioImporte_Enabled ;
      private int edtIngredientePrecioEstado_Enabled ;
      private int subGridingrediente_precio_Selectioncolor ;
      private int subGridingrediente_precio_Hoveringcolor ;
      private int fRowAdded ;
      private int imgBtn_first_Visible ;
      private int imgBtn_first_separator_Visible ;
      private int imgBtn_previous_Visible ;
      private int imgBtn_previous_separator_Visible ;
      private int imgBtn_next_Visible ;
      private int imgBtn_next_separator_Visible ;
      private int imgBtn_last_Visible ;
      private int imgBtn_last_separator_Visible ;
      private int imgBtn_select_Visible ;
      private int imgBtn_select_separator_Visible ;
      private int imgBtn_enter2_Visible ;
      private int imgBtn_enter2_Enabled ;
      private int imgBtn_enter2_separator_Visible ;
      private int imgBtn_cancel2_Visible ;
      private int imgBtn_cancel2_separator_Visible ;
      private int imgBtn_delete2_Visible ;
      private int imgBtn_delete2_Enabled ;
      private int imgBtn_delete2_separator_Visible ;
      private int GRIDINGREDIENTE_PRECIO_nFirstRecordOnPage ;
      private int subGridingrediente_precio_Backcolor ;
      private int subGridingrediente_precio_Allbackcolor ;
      private int imgprompt_32_Visible ;
      private int defedtIngredientePrecioFechaVigencia_Enabled ;
      private int defedtProveedorId_Enabled ;
      private int idxLst ;
      private long A32ProveedorId ;
      private long A24IngredienteId ;
      private long Z24IngredienteId ;
      private long Z32ProveedorId ;
      private decimal A26IngredienteCosto ;
      private decimal A29IngredienteStock ;
      private decimal A35IngredientePrecioImporte ;
      private decimal Z26IngredienteCosto ;
      private decimal Z29IngredienteStock ;
      private decimal Z35IngredientePrecioImporte ;
      private String sPrefix ;
      private String sGXsfl_76_idx="0001" ;
      private String scmdbuf ;
      private String gxfirstwebparm ;
      private String gxfirstwebparm_bkp ;
      private String GXKey ;
      private String PreviousTooltip ;
      private String PreviousCaption ;
      private String GX_FocusControl ;
      private String edtIngredienteId_Internalname ;
      private String sStyleString ;
      private String tblTablemain_Internalname ;
      private String ClassString ;
      private String StyleString ;
      private String grpGroupdata_Internalname ;
      private String tblTable1_Internalname ;
      private String TempTags ;
      private String bttBtn_enter_Internalname ;
      private String bttBtn_enter_Jsonclick ;
      private String bttBtn_cancel_Internalname ;
      private String bttBtn_cancel_Jsonclick ;
      private String bttBtn_delete_Internalname ;
      private String bttBtn_delete_Jsonclick ;
      private String tblTable2_Internalname ;
      private String lblTextblockingredienteid_Internalname ;
      private String lblTextblockingredienteid_Jsonclick ;
      private String edtIngredienteId_Jsonclick ;
      private String lblTextblockingredientedescripcion_Internalname ;
      private String lblTextblockingredientedescripcion_Jsonclick ;
      private String edtIngredienteDescripcion_Internalname ;
      private String lblTextblockingredientecosto_Internalname ;
      private String lblTextblockingredientecosto_Jsonclick ;
      private String edtIngredienteCosto_Internalname ;
      private String edtIngredienteCosto_Jsonclick ;
      private String lblTextblockingredienteunidadmedida_Internalname ;
      private String lblTextblockingredienteunidadmedida_Jsonclick ;
      private String edtIngredienteUnidadMedida_Internalname ;
      private String A28IngredienteUnidadMedida ;
      private String edtIngredienteUnidadMedida_Jsonclick ;
      private String lblTextblockingredientestock_Internalname ;
      private String lblTextblockingredientestock_Jsonclick ;
      private String edtIngredienteStock_Internalname ;
      private String edtIngredienteStock_Jsonclick ;
      private String lblTextblockingredienteestado_Internalname ;
      private String lblTextblockingredienteestado_Jsonclick ;
      private String edtIngredienteEstado_Internalname ;
      private String A30IngredienteEstado ;
      private String edtIngredienteEstado_Jsonclick ;
      private String lblTextblockingredientetipo_Internalname ;
      private String lblTextblockingredientetipo_Jsonclick ;
      private String edtIngredienteTipo_Internalname ;
      private String A31IngredienteTipo ;
      private String edtIngredienteTipo_Jsonclick ;
      private String A36IngredientePrecioEstado ;
      private String Gx_mode ;
      private String sMode9 ;
      private String imgprompt_32_Link ;
      private String edtProveedorId_Internalname ;
      private String tblTable3_Internalname ;
      private String lblTitleprecio_Internalname ;
      private String lblTitleprecio_Jsonclick ;
      private String tblTabletoolbar_Internalname ;
      private String divSectiontoolbar_Internalname ;
      private String imgBtn_first_Internalname ;
      private String imgBtn_first_Jsonclick ;
      private String imgBtn_first_separator_Internalname ;
      private String imgBtn_first_separator_Jsonclick ;
      private String imgBtn_previous_Internalname ;
      private String imgBtn_previous_Jsonclick ;
      private String imgBtn_previous_separator_Internalname ;
      private String imgBtn_previous_separator_Jsonclick ;
      private String imgBtn_next_Internalname ;
      private String imgBtn_next_Jsonclick ;
      private String imgBtn_next_separator_Internalname ;
      private String imgBtn_next_separator_Jsonclick ;
      private String imgBtn_last_Internalname ;
      private String imgBtn_last_Jsonclick ;
      private String imgBtn_last_separator_Internalname ;
      private String imgBtn_last_separator_Jsonclick ;
      private String imgBtn_select_Internalname ;
      private String imgBtn_select_Jsonclick ;
      private String imgBtn_select_separator_Internalname ;
      private String imgBtn_select_separator_Jsonclick ;
      private String imgBtn_enter2_Internalname ;
      private String imgBtn_enter2_Jsonclick ;
      private String imgBtn_enter2_separator_Internalname ;
      private String imgBtn_enter2_separator_Jsonclick ;
      private String imgBtn_cancel2_Internalname ;
      private String imgBtn_cancel2_Jsonclick ;
      private String imgBtn_cancel2_separator_Internalname ;
      private String imgBtn_cancel2_separator_Jsonclick ;
      private String imgBtn_delete2_Internalname ;
      private String imgBtn_delete2_Jsonclick ;
      private String imgBtn_delete2_separator_Internalname ;
      private String imgBtn_delete2_separator_Jsonclick ;
      private String Z28IngredienteUnidadMedida ;
      private String Z30IngredienteEstado ;
      private String Z31IngredienteTipo ;
      private String sEvt ;
      private String EvtGridId ;
      private String EvtRowId ;
      private String sEvtType ;
      private String edtIngredientePrecioFechaVigencia_Internalname ;
      private String edtIngredientePrecioImporte_Internalname ;
      private String edtIngredientePrecioEstado_Internalname ;
      private String Z36IngredientePrecioEstado ;
      private String sMode6 ;
      private String imgprompt_32_Internalname ;
      private String subGridingrediente_precio_Class ;
      private String subGridingrediente_precio_Linesclass ;
      private String ROClassString ;
      private String edtProveedorId_Jsonclick ;
      private String edtIngredientePrecioFechaVigencia_Jsonclick ;
      private String edtIngredientePrecioImporte_Jsonclick ;
      private String edtIngredientePrecioEstado_Jsonclick ;
      private String GXCCtl ;
      private String sDynURL ;
      private String FormProcess ;
      private String subGridingrediente_precio_Internalname ;
      private DateTime A34IngredientePrecioFechaVigencia ;
      private DateTime Z34IngredientePrecioFechaVigencia ;
      private bool entryPointCalled ;
      private bool wbErr ;
      private bool Gx_longc ;
      private String A27IngredienteDescripcion ;
      private String Z27IngredienteDescripcion ;
      private GxUnknownObjectCollection isValidOutput ;
      private GXMasterPage MasterPageObj ;
      private GXWebGrid Gridingrediente_precioContainer ;
      private GXWebRow Gridingrediente_precioRow ;
      private GXWebColumn Gridingrediente_precioColumn ;
      private IGxDataStore dsDefault ;
      private IDataStoreProvider pr_default ;
      private long[] T00047_A24IngredienteId ;
      private String[] T00047_A27IngredienteDescripcion ;
      private decimal[] T00047_A26IngredienteCosto ;
      private String[] T00047_A28IngredienteUnidadMedida ;
      private decimal[] T00047_A29IngredienteStock ;
      private String[] T00047_A30IngredienteEstado ;
      private String[] T00047_A31IngredienteTipo ;
      private long[] T00048_A24IngredienteId ;
      private long[] T00046_A24IngredienteId ;
      private String[] T00046_A27IngredienteDescripcion ;
      private decimal[] T00046_A26IngredienteCosto ;
      private String[] T00046_A28IngredienteUnidadMedida ;
      private decimal[] T00046_A29IngredienteStock ;
      private String[] T00046_A30IngredienteEstado ;
      private String[] T00046_A31IngredienteTipo ;
      private long[] T00049_A24IngredienteId ;
      private long[] T000410_A24IngredienteId ;
      private long[] T000411_A24IngredienteId ;
      private String[] T000411_A27IngredienteDescripcion ;
      private decimal[] T000411_A26IngredienteCosto ;
      private String[] T000411_A28IngredienteUnidadMedida ;
      private decimal[] T000411_A29IngredienteStock ;
      private String[] T000411_A30IngredienteEstado ;
      private String[] T000411_A31IngredienteTipo ;
      private long[] T000415_A16ProductoId ;
      private long[] T000415_A24IngredienteId ;
      private long[] T000416_A24IngredienteId ;
      private long[] T000417_A24IngredienteId ;
      private DateTime[] T000417_A34IngredientePrecioFechaVigencia ;
      private decimal[] T000417_A35IngredientePrecioImporte ;
      private String[] T000417_A36IngredientePrecioEstado ;
      private long[] T000417_A32ProveedorId ;
      private long[] T00044_A32ProveedorId ;
      private long[] T000418_A32ProveedorId ;
      private long[] T000419_A24IngredienteId ;
      private long[] T000419_A32ProveedorId ;
      private DateTime[] T000419_A34IngredientePrecioFechaVigencia ;
      private long[] T00043_A24IngredienteId ;
      private DateTime[] T00043_A34IngredientePrecioFechaVigencia ;
      private decimal[] T00043_A35IngredientePrecioImporte ;
      private String[] T00043_A36IngredientePrecioEstado ;
      private long[] T00043_A32ProveedorId ;
      private long[] T00042_A24IngredienteId ;
      private DateTime[] T00042_A34IngredientePrecioFechaVigencia ;
      private decimal[] T00042_A35IngredientePrecioImporte ;
      private String[] T00042_A36IngredientePrecioEstado ;
      private long[] T00042_A32ProveedorId ;
      private long[] T000423_A24IngredienteId ;
      private long[] T000423_A32ProveedorId ;
      private DateTime[] T000423_A34IngredientePrecioFechaVigencia ;
      private long[] T000424_A32ProveedorId ;
      private long[] T00045_A24IngredienteId ;
      private String[] T00045_A27IngredienteDescripcion ;
      private decimal[] T00045_A26IngredienteCosto ;
      private String[] T00045_A28IngredienteUnidadMedida ;
      private decimal[] T00045_A29IngredienteStock ;
      private String[] T00045_A30IngredienteEstado ;
      private String[] T00045_A31IngredienteTipo ;
      private GXWebForm Form ;
   }

   public class ingrediente__default : DataStoreHelperBase, IDataStoreHelper
   {
      public ICursor[] getCursors( )
      {
         cursorDefinitions();
         return new Cursor[] {
          new ForEachCursor(def[0])
         ,new ForEachCursor(def[1])
         ,new ForEachCursor(def[2])
         ,new ForEachCursor(def[3])
         ,new ForEachCursor(def[4])
         ,new ForEachCursor(def[5])
         ,new ForEachCursor(def[6])
         ,new ForEachCursor(def[7])
         ,new ForEachCursor(def[8])
         ,new ForEachCursor(def[9])
         ,new UpdateCursor(def[10])
         ,new UpdateCursor(def[11])
         ,new UpdateCursor(def[12])
         ,new ForEachCursor(def[13])
         ,new ForEachCursor(def[14])
         ,new ForEachCursor(def[15])
         ,new ForEachCursor(def[16])
         ,new ForEachCursor(def[17])
         ,new UpdateCursor(def[18])
         ,new UpdateCursor(def[19])
         ,new UpdateCursor(def[20])
         ,new ForEachCursor(def[21])
         ,new ForEachCursor(def[22])
       };
    }

    private static CursorDef[] def;
    private void cursorDefinitions( )
    {
       if ( def == null )
       {
          Object[] prmT00045 ;
          prmT00045 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00047 ;
          prmT00047 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00048 ;
          prmT00048 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00046 ;
          prmT00046 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT00049 ;
          prmT00049 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000410 ;
          prmT000410 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000411 ;
          prmT000411 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000412 ;
          prmT000412 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredienteDescripcion",SqlDbType.VarChar,200,0} ,
          new Object[] {"@IngredienteCosto",SqlDbType.Decimal,5,2} ,
          new Object[] {"@IngredienteUnidadMedida",SqlDbType.Char,20,0} ,
          new Object[] {"@IngredienteStock",SqlDbType.Decimal,6,3} ,
          new Object[] {"@IngredienteEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@IngredienteTipo",SqlDbType.Char,20,0}
          } ;
          Object[] prmT000413 ;
          prmT000413 = new Object[] {
          new Object[] {"@IngredienteDescripcion",SqlDbType.VarChar,200,0} ,
          new Object[] {"@IngredienteCosto",SqlDbType.Decimal,5,2} ,
          new Object[] {"@IngredienteUnidadMedida",SqlDbType.Char,20,0} ,
          new Object[] {"@IngredienteStock",SqlDbType.Decimal,6,3} ,
          new Object[] {"@IngredienteEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@IngredienteTipo",SqlDbType.Char,20,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000414 ;
          prmT000414 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000415 ;
          prmT000415 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000416 ;
          prmT000416 = new Object[] {
          } ;
          Object[] prmT000417 ;
          prmT000417 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT00044 ;
          prmT00044 = new Object[] {
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000418 ;
          prmT000418 = new Object[] {
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000419 ;
          prmT000419 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT00043 ;
          prmT00043 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT00042 ;
          prmT00042 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT000420 ;
          prmT000420 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0} ,
          new Object[] {"@IngredientePrecioImporte",SqlDbType.Decimal,5,2} ,
          new Object[] {"@IngredientePrecioEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000421 ;
          prmT000421 = new Object[] {
          new Object[] {"@IngredientePrecioImporte",SqlDbType.Decimal,5,2} ,
          new Object[] {"@IngredientePrecioEstado",SqlDbType.Char,1,0} ,
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT000422 ;
          prmT000422 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0} ,
          new Object[] {"@IngredientePrecioFechaVigencia",SqlDbType.DateTime,8,0}
          } ;
          Object[] prmT000423 ;
          prmT000423 = new Object[] {
          new Object[] {"@IngredienteId",SqlDbType.Decimal,10,0}
          } ;
          Object[] prmT000424 ;
          prmT000424 = new Object[] {
          new Object[] {"@ProveedorId",SqlDbType.Decimal,10,0}
          } ;
          def= new CursorDef[] {
              new CursorDef("T00042", "SELECT [IngredienteId], [IngredientePrecioFechaVigencia], [IngredientePrecioImporte], [IngredientePrecioEstado], [ProveedorId] FROM [IngredientePrecio] WITH (UPDLOCK) WHERE [IngredienteId] = @IngredienteId AND [ProveedorId] = @ProveedorId AND [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia ",true, GxErrorMask.GX_NOMASK, false, this,prmT00042,1,0,true,false )
             ,new CursorDef("T00043", "SELECT [IngredienteId], [IngredientePrecioFechaVigencia], [IngredientePrecioImporte], [IngredientePrecioEstado], [ProveedorId] FROM [IngredientePrecio] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId AND [ProveedorId] = @ProveedorId AND [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia ",true, GxErrorMask.GX_NOMASK, false, this,prmT00043,1,0,true,false )
             ,new CursorDef("T00044", "SELECT [ProveedorId] FROM [Proveedor] WITH (NOLOCK) WHERE [ProveedorId] = @ProveedorId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00044,1,0,true,false )
             ,new CursorDef("T00045", "SELECT [IngredienteId], [IngredienteDescripcion], [IngredienteCosto], [IngredienteUnidadMedida], [IngredienteStock], [IngredienteEstado], [IngredienteTipo] FROM [Ingrediente] WITH (UPDLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00045,1,0,true,false )
             ,new CursorDef("T00046", "SELECT [IngredienteId], [IngredienteDescripcion], [IngredienteCosto], [IngredienteUnidadMedida], [IngredienteStock], [IngredienteEstado], [IngredienteTipo] FROM [Ingrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT00046,1,0,true,false )
             ,new CursorDef("T00047", "SELECT TM1.[IngredienteId], TM1.[IngredienteDescripcion], TM1.[IngredienteCosto], TM1.[IngredienteUnidadMedida], TM1.[IngredienteStock], TM1.[IngredienteEstado], TM1.[IngredienteTipo] FROM [Ingrediente] TM1 WITH (NOLOCK) WHERE TM1.[IngredienteId] = @IngredienteId ORDER BY TM1.[IngredienteId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT00047,100,0,true,false )
             ,new CursorDef("T00048", "SELECT [IngredienteId] FROM [Ingrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT00048,1,0,true,false )
             ,new CursorDef("T00049", "SELECT TOP 1 [IngredienteId] FROM [Ingrediente] WITH (NOLOCK) WHERE ( [IngredienteId] > @IngredienteId) ORDER BY [IngredienteId]  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT00049,1,0,true,true )
             ,new CursorDef("T000410", "SELECT TOP 1 [IngredienteId] FROM [Ingrediente] WITH (NOLOCK) WHERE ( [IngredienteId] < @IngredienteId) ORDER BY [IngredienteId] DESC  OPTION (FAST 1)",true, GxErrorMask.GX_NOMASK, false, this,prmT000410,1,0,true,true )
             ,new CursorDef("T000411", "SELECT [IngredienteId], [IngredienteDescripcion], [IngredienteCosto], [IngredienteUnidadMedida], [IngredienteStock], [IngredienteEstado], [IngredienteTipo] FROM [Ingrediente] WITH (UPDLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000411,1,0,true,false )
             ,new CursorDef("T000412", "INSERT INTO [Ingrediente] ([IngredienteId], [IngredienteDescripcion], [IngredienteCosto], [IngredienteUnidadMedida], [IngredienteStock], [IngredienteEstado], [IngredienteTipo]) VALUES (@IngredienteId, @IngredienteDescripcion, @IngredienteCosto, @IngredienteUnidadMedida, @IngredienteStock, @IngredienteEstado, @IngredienteTipo)", GxErrorMask.GX_NOMASK,prmT000412)
             ,new CursorDef("T000413", "UPDATE [Ingrediente] SET [IngredienteDescripcion]=@IngredienteDescripcion, [IngredienteCosto]=@IngredienteCosto, [IngredienteUnidadMedida]=@IngredienteUnidadMedida, [IngredienteStock]=@IngredienteStock, [IngredienteEstado]=@IngredienteEstado, [IngredienteTipo]=@IngredienteTipo  WHERE [IngredienteId] = @IngredienteId", GxErrorMask.GX_NOMASK,prmT000413)
             ,new CursorDef("T000414", "DELETE FROM [Ingrediente]  WHERE [IngredienteId] = @IngredienteId", GxErrorMask.GX_NOMASK,prmT000414)
             ,new CursorDef("T000415", "SELECT TOP 1 [ProductoId], [IngredienteId] FROM [ProductoIngrediente] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000415,1,0,true,true )
             ,new CursorDef("T000416", "SELECT [IngredienteId] FROM [Ingrediente] WITH (NOLOCK) ORDER BY [IngredienteId]  OPTION (FAST 100)",true, GxErrorMask.GX_NOMASK, false, this,prmT000416,100,0,true,false )
             ,new CursorDef("T000417", "SELECT [IngredienteId], [IngredientePrecioFechaVigencia], [IngredientePrecioImporte], [IngredientePrecioEstado], [ProveedorId] FROM [IngredientePrecio] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId and [ProveedorId] = @ProveedorId and [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia ORDER BY [IngredienteId], [ProveedorId], [IngredientePrecioFechaVigencia] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000417,11,0,true,false )
             ,new CursorDef("T000418", "SELECT [ProveedorId] FROM [Proveedor] WITH (NOLOCK) WHERE [ProveedorId] = @ProveedorId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000418,1,0,true,false )
             ,new CursorDef("T000419", "SELECT [IngredienteId], [ProveedorId], [IngredientePrecioFechaVigencia] FROM [IngredientePrecio] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId AND [ProveedorId] = @ProveedorId AND [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia ",true, GxErrorMask.GX_NOMASK, false, this,prmT000419,1,0,true,false )
             ,new CursorDef("T000420", "INSERT INTO [IngredientePrecio] ([IngredienteId], [IngredientePrecioFechaVigencia], [IngredientePrecioImporte], [IngredientePrecioEstado], [ProveedorId]) VALUES (@IngredienteId, @IngredientePrecioFechaVigencia, @IngredientePrecioImporte, @IngredientePrecioEstado, @ProveedorId)", GxErrorMask.GX_NOMASK,prmT000420)
             ,new CursorDef("T000421", "UPDATE [IngredientePrecio] SET [IngredientePrecioImporte]=@IngredientePrecioImporte, [IngredientePrecioEstado]=@IngredientePrecioEstado  WHERE [IngredienteId] = @IngredienteId AND [ProveedorId] = @ProveedorId AND [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia", GxErrorMask.GX_NOMASK,prmT000421)
             ,new CursorDef("T000422", "DELETE FROM [IngredientePrecio]  WHERE [IngredienteId] = @IngredienteId AND [ProveedorId] = @ProveedorId AND [IngredientePrecioFechaVigencia] = @IngredientePrecioFechaVigencia", GxErrorMask.GX_NOMASK,prmT000422)
             ,new CursorDef("T000423", "SELECT [IngredienteId], [ProveedorId], [IngredientePrecioFechaVigencia] FROM [IngredientePrecio] WITH (NOLOCK) WHERE [IngredienteId] = @IngredienteId ORDER BY [IngredienteId], [ProveedorId], [IngredientePrecioFechaVigencia] ",true, GxErrorMask.GX_NOMASK, false, this,prmT000423,11,0,true,false )
             ,new CursorDef("T000424", "SELECT [ProveedorId] FROM [Proveedor] WITH (NOLOCK) WHERE [ProveedorId] = @ProveedorId ",true, GxErrorMask.GX_NOMASK, false, this,prmT000424,1,0,true,false )
          };
       }
    }

    public void getResults( int cursor ,
                            IFieldGetter rslt ,
                            Object[] buf )
    {
       switch ( cursor )
       {
             case 0 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((DateTime[]) buf[1])[0] = rslt.getGXDate(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((long[]) buf[4])[0] = rslt.getLong(5) ;
                break;
             case 1 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((DateTime[]) buf[1])[0] = rslt.getGXDate(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((long[]) buf[4])[0] = rslt.getLong(5) ;
                break;
             case 2 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 3 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 20) ;
                ((decimal[]) buf[4])[0] = rslt.getDecimal(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 1) ;
                ((String[]) buf[6])[0] = rslt.getString(7, 20) ;
                break;
             case 4 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 20) ;
                ((decimal[]) buf[4])[0] = rslt.getDecimal(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 1) ;
                ((String[]) buf[6])[0] = rslt.getString(7, 20) ;
                break;
             case 5 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 20) ;
                ((decimal[]) buf[4])[0] = rslt.getDecimal(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 1) ;
                ((String[]) buf[6])[0] = rslt.getString(7, 20) ;
                break;
             case 6 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 7 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 8 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 9 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((String[]) buf[1])[0] = rslt.getVarchar(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 20) ;
                ((decimal[]) buf[4])[0] = rslt.getDecimal(5) ;
                ((String[]) buf[5])[0] = rslt.getString(6, 1) ;
                ((String[]) buf[6])[0] = rslt.getString(7, 20) ;
                break;
             case 13 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                break;
             case 14 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 15 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((DateTime[]) buf[1])[0] = rslt.getGXDate(2) ;
                ((decimal[]) buf[2])[0] = rslt.getDecimal(3) ;
                ((String[]) buf[3])[0] = rslt.getString(4, 1) ;
                ((long[]) buf[4])[0] = rslt.getLong(5) ;
                break;
             case 16 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
             case 17 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                ((DateTime[]) buf[2])[0] = rslt.getGXDate(3) ;
                break;
             case 21 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                ((long[]) buf[1])[0] = rslt.getLong(2) ;
                ((DateTime[]) buf[2])[0] = rslt.getGXDate(3) ;
                break;
             case 22 :
                ((long[]) buf[0])[0] = rslt.getLong(1) ;
                break;
       }
    }

    public void setParameters( int cursor ,
                               IFieldSetter stmt ,
                               Object[] parms )
    {
       switch ( cursor )
       {
             case 0 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                break;
             case 1 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                break;
             case 2 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 3 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 4 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 5 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 6 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 7 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 8 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 9 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 10 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (decimal)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (decimal)parms[4]);
                stmt.SetParameter(6, (String)parms[5]);
                stmt.SetParameter(7, (String)parms[6]);
                break;
             case 11 :
                stmt.SetParameter(1, (String)parms[0]);
                stmt.SetParameter(2, (decimal)parms[1]);
                stmt.SetParameter(3, (String)parms[2]);
                stmt.SetParameter(4, (decimal)parms[3]);
                stmt.SetParameter(5, (String)parms[4]);
                stmt.SetParameter(6, (String)parms[5]);
                stmt.SetParameter(7, (long)parms[6]);
                break;
             case 12 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 13 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 15 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                break;
             case 16 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 17 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                break;
             case 18 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (DateTime)parms[1]);
                stmt.SetParameter(3, (decimal)parms[2]);
                stmt.SetParameter(4, (String)parms[3]);
                stmt.SetParameter(5, (long)parms[4]);
                break;
             case 19 :
                stmt.SetParameter(1, (decimal)parms[0]);
                stmt.SetParameter(2, (String)parms[1]);
                stmt.SetParameter(3, (long)parms[2]);
                stmt.SetParameter(4, (long)parms[3]);
                stmt.SetParameter(5, (DateTime)parms[4]);
                break;
             case 20 :
                stmt.SetParameter(1, (long)parms[0]);
                stmt.SetParameter(2, (long)parms[1]);
                stmt.SetParameter(3, (DateTime)parms[2]);
                break;
             case 21 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
             case 22 :
                stmt.SetParameter(1, (long)parms[0]);
                break;
       }
    }

 }

}
